McdMission

## McdMission McdMission — Base class for server classes |

## Stability Level

Unstable, unless otherwise indicated

## Synopsis

    #include <mcd-mission.h>

                        McdMission;
    #define             MCD_MISSION_GET_FLAGS_MASKED        (mission, flags)
    #define             MCD_MISSION_SET_FLAGS_MASKED        (mission, flags)
    #define             MCD_MISSION_UNSET_FLAGS_MASKED      (mission, flags)
    enum                McdMode;
    enum                McdSystemFlags;
    McdMission*         mcd_mission_new                     (void);
    gboolean            mcd_mission_is_connected            (McdMission *mission);
    McdMission*         mcd_mission_get_parent              (McdMission *mission);
    void                mcd_mission_abort                   (McdMission *mission);
    void                mcd_mission_set_parent              (McdMission *mission,
                                                             McdMission *parent);
    void                mcd_mission_connect                 (McdMission *mission);
    void                mcd_mission_disconnect              (McdMission *mission);
    void                mcd_mission_set_flags               (McdMission *mission,
                                                             McdSystemFlags flags);
    McdSystemFlags      mcd_mission_get_flags               (McdMission *mission);
    void                mcd_mission_set_mode                (McdMission *mission,
                                                             McdMode mode);
    McdMode             mcd_mission_get_mode                (McdMission *mission);

## Description

It is the base class for every object in mission-control. It defines a set of virtual functions and set of corresponding action signals. all virtual functions results in emission of their corresponding action signals. The virtual functions define states of the object, such as memory conserved state, connected state, locked state, low power state, lit state, sleeping state etc. Each of the object states can also be queried independently as properties.

There are also some action signals such as abort, which is used to notify other objects holding hard references to it to release them (this object should then automatically die since all held references are released). It is mandatory for all other objects that hold a hard reference to it to listen for this signal and release the reference in signal handler.

Concrete derived classes should override the sate methods to implement object specific state managements.

## Details

### McdMission

    typedef struct {
        GObject parent;
    } McdMission;

### MCD_MISSION_GET_FLAGS_MASKED()

    #define             MCD_MISSION_GET_FLAGS_MASKED(mission, flags)

`mission` : |
`flags` : |

### MCD_MISSION_SET_FLAGS_MASKED()

    #define             MCD_MISSION_SET_FLAGS_MASKED(mission, flags)

`mission` : |
`flags` : |

### MCD_MISSION_UNSET_FLAGS_MASKED()

    #define             MCD_MISSION_UNSET_FLAGS_MASKED(mission, flags)

`mission` : |
`flags` : |

### enum McdMode

    typedef enum
    {
        MCD_MODE_UNKNOWN,
        MCD_MODE_NORMAL,
        MCD_MODE_RESTRICTED,
        MCD_MODE_CALL
    } McdMode;

### enum McdSystemFlags

    typedef enum
    {
        MCD_SYSTEM_CONNECTED          = 1,
        MCD_SYSTEM_MEMORY_CONSERVED   = 1 << 1,
        MCD_SYSTEM_POWER_CONSERVED    = 1 << 2,
        MCD_SYSTEM_SCREEN_BLANKED     = 1 << 3,
        MCD_SYSTEM_LOCKED             = 1 << 4,
        MCD_SYSTEM_IDLE               = 1 << 5
    } McdSystemFlags;

### mcd_mission_new ()

    McdMission*         mcd_mission_new                     (void);

Returns : |

### mcd_mission_is_connected ()

    gboolean            mcd_mission_is_connected            (McdMission *mission);

`mission` : |
Returns : |

### mcd_mission_get_parent ()

    McdMission*         mcd_mission_get_parent              (McdMission *mission);

`mission` : |
Returns : |

### mcd_mission_abort ()

    void                mcd_mission_abort                   (McdMission *mission);

`mission` : |

### mcd_mission_set_parent ()

    void                mcd_mission_set_parent              (McdMission *mission,
                                                             McdMission *parent);

`mission` : |
`parent` : |

### mcd_mission_connect ()

    void                mcd_mission_connect                 (McdMission *mission);

`mission` : |

### mcd_mission_disconnect ()

    void                mcd_mission_disconnect              (McdMission *mission);

`mission` : |

### mcd_mission_set_flags ()

    void                mcd_mission_set_flags               (McdMission *mission,
                                                             McdSystemFlags flags);

`mission` : |
`flags` : |

### mcd_mission_get_flags ()

    McdSystemFlags      mcd_mission_get_flags               (McdMission *mission);

`mission` : |
Returns : |

### mcd_mission_set_mode ()

    void                mcd_mission_set_mode                (McdMission *mission,
                                                             McdMode mode);

`mission` : |
`mode` : |

### mcd_mission_get_mode ()

    McdMode             mcd_mission_get_mode                (McdMission *mission);

`mission` : |
Returns : |