taskswitcher/server/inc/tswindowgroupsmonitor.h
changeset 125 26079c1bb561
parent 123 d1dadafc5584
child 126 efda7c0771b9
equal deleted inserted replaced
123:d1dadafc5584 125:26079c1bb561
     1 /*
       
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description :
       
    15  *
       
    16  */
       
    17 #ifndef TSWINDOWGROUPMONITOR_H
       
    18 #define TSWINDOWGROUPMONITOR_H
       
    19 
       
    20 #include "tswindowgroupsobserver.h"
       
    21 
       
    22 /**
       
    23  * Window server monitor implementation.
       
    24  */
       
    25 class CTsWindowGroupsMonitor: public CActive, 
       
    26                               public MTsWindowGroupsMonitor
       
    27                               
       
    28 {
       
    29 public:
       
    30     /**
       
    31      * Two phase constructor
       
    32      */
       
    33     static CTsWindowGroupsMonitor* NewL(MTsResourceManager &);
       
    34     
       
    35     /**
       
    36      * Destructor
       
    37      */
       
    38     ~CTsWindowGroupsMonitor();
       
    39     
       
    40     /**
       
    41      * @see MTsWindowGroupsMonitor::SubscribeL
       
    42      */
       
    43     void SubscribeL(MTsWindowGroupsObserver &);
       
    44     
       
    45     /**
       
    46      * @see MTsWindowGroupsMonitor::Cancel
       
    47      */
       
    48     void Cancel(MTsWindowGroupsObserver &);
       
    49 
       
    50 protected:
       
    51     /**
       
    52      * @see CActive::RunL
       
    53      */
       
    54     void RunL();
       
    55     
       
    56     /**
       
    57      * @see CActive::DoCancel
       
    58      */
       
    59     void DoCancel();
       
    60     
       
    61     /**
       
    62      * @see CActive::RunError
       
    63      */
       
    64     TInt RunError(TInt error);
       
    65 
       
    66 private:
       
    67     /**
       
    68      * First phase constructor
       
    69      */
       
    70     CTsWindowGroupsMonitor(MTsResourceManager &);
       
    71     
       
    72     /**
       
    73      * Second phase constructor
       
    74      */
       
    75     void ConstructL();
       
    76     
       
    77     /**
       
    78      * Function subscribe for event to window server and activate object
       
    79      */
       
    80     void Subscribe();
       
    81     
       
    82     /**
       
    83      * Function provide window server event to observers
       
    84      */
       
    85     void ProvideEventL();
       
    86     
       
    87 private:
       
    88     /**
       
    89      * Registry of subscribed observers
       
    90      */
       
    91     RPointerArray<MTsWindowGroupsObserver> iObservers;
       
    92     
       
    93     /**
       
    94      * Resources manager
       
    95      */
       
    96     MTsResourceManager &iResources;
       
    97     
       
    98     /**
       
    99      * Monitor window group
       
   100      */
       
   101     RWindowGroup iWg;
       
   102 };
       
   103 #endif//TSWINDOWGROUPMONITOR_H