contextframework/cfwplugins/displaysourceplugin/inc/displayservicebase.h
changeset 0 2e3d3ce01487
equal deleted inserted replaced
-1:000000000000 0:2e3d3ce01487
       
     1 /*
       
     2 * Copyright (c) 2009-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:  CDisplayContextBase class declaration.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef DISPLAYSERVICEBASE_H
       
    20 #define DISPLAYSERVICEBASE_H
       
    21 
       
    22 // SYSTEM INCLUDE FILES
       
    23 #include <e32base.h>
       
    24 
       
    25 // USER INCLUDE FILES
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class CCFContextObject;
       
    29 class MCFContextInterface;
       
    30 
       
    31 // DATA TYPES
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36  * Base class for all display type contexts.
       
    37  *
       
    38  * @lib None.
       
    39  * @since S60 5.0
       
    40  */
       
    41 NONSHARABLE_CLASS( CDisplayServiceBase ): public CBase
       
    42     {
       
    43 public:
       
    44     
       
    45     // Display service type
       
    46     enum TDisplayServiceType
       
    47         {
       
    48         EDisplayLightStatus,
       
    49         EDisplayUILayout
       
    50         };
       
    51     
       
    52     virtual ~CDisplayServiceBase();
       
    53     
       
    54 public:
       
    55     
       
    56     /**
       
    57      * Start the display service.
       
    58      * All the contexts must be defined here and also the initial value needs
       
    59      * to be set. This can also be done asynchronously.
       
    60      * 
       
    61      * @since S60 5.0
       
    62      * @param None.
       
    63      * @return None.
       
    64      */
       
    65     virtual void StartL() = 0;
       
    66     
       
    67     /**
       
    68      * Stop the display service.
       
    69      * 
       
    70      * @since S60 5.0
       
    71      * @param None.
       
    72      * @return None.
       
    73      */
       
    74     virtual void Stop() = 0;
       
    75     
       
    76 public:
       
    77     
       
    78     /**
       
    79      * Return the display context type.
       
    80      * 
       
    81      * @since S60 5.0
       
    82      * @param None.
       
    83      * @return None.
       
    84      */
       
    85     TInt DisplayServiceType() const;
       
    86     
       
    87 protected:
       
    88 
       
    89     /**
       
    90      * Default C++ constructor.
       
    91      */
       
    92     CDisplayServiceBase( TDisplayServiceType aType,
       
    93         MCFContextInterface& aCF );
       
    94     
       
    95     /**
       
    96      * Symbian 2nd phase constructor.
       
    97      */
       
    98     void ConstructL();
       
    99 
       
   100 protected: // Data
       
   101     
       
   102     /** Context associated with the display service */
       
   103     CCFContextObject* iContext;
       
   104     
       
   105     /** Reference to the Context Access API */
       
   106     MCFContextInterface& iCF;
       
   107     
       
   108     /** Handle to the current thread */
       
   109     RThread iThread;
       
   110 
       
   111 private: // Private data
       
   112     
       
   113     /** Display context type */
       
   114     TDisplayServiceType iType;
       
   115     };
       
   116 
       
   117 #endif // DISPLAYCONTEXTBASE_H