contextframework/cfw/inc/cfserver/cfpublishcontextcmd.h
changeset 0 2e3d3ce01487
equal deleted inserted replaced
-1:000000000000 0:2e3d3ce01487
       
     1 /*
       
     2 * Copyright (c) 2008 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:  CCFPublishContextCmd class declaration.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CFPUBLISHCONTEXTCMD_H
       
    20 #define C_CFPUBLISHCONTEXTCMD_H
       
    21 
       
    22 
       
    23 // SYSTEM INCLUDE FILES
       
    24 #include <e32base.h>
       
    25 
       
    26 // USER INCLUDE FILES
       
    27 #include "cfcmd.h"
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CCFContextManager;
       
    31 class CCFContextObject;
       
    32 class CCFContextDataObject;
       
    33 class CCFContextDataProxy;
       
    34 
       
    35 // DATA TYPES
       
    36 
       
    37 // CLASS DECLARATION
       
    38 
       
    39 /**
       
    40  * Publish context command.
       
    41  *
       
    42  * @lib CFServer
       
    43  * @since S60 5.0
       
    44  */
       
    45 NONSHARABLE_CLASS( CCFPublishContextCmd ) : public CCFCmd
       
    46     {
       
    47 public:
       
    48 
       
    49     /**
       
    50      * Symbian two phased constructors.
       
    51      *
       
    52      * @since S60 5.0
       
    53      * @param aContextManager is the manager handling context subscriptions.
       
    54      * @param aContext is the context to be published.
       
    55      * @return CCFPublishContextCmd
       
    56      */
       
    57     static CCFPublishContextCmd* NewL( CCFContextManager& aContextManager,
       
    58             const CCFContextObject& aContext );
       
    59     static CCFPublishContextCmd* NewLC( CCFContextManager& aContextManager,
       
    60             const CCFContextObject& aContext );
       
    61 
       
    62     /**
       
    63      * Symbian two phased constructors.
       
    64      *
       
    65      * @since S60 5.0
       
    66      * @param aContextManager is the manager handling context subscriptions.
       
    67      * @param aContext is the context to be published.
       
    68      * @param aData is the context data to be published.
       
    69      * @return CCFPublishContextCmd
       
    70      */
       
    71     static CCFPublishContextCmd* NewL( CCFContextManager& aContextManager,
       
    72             const CCFContextObject& aContext,
       
    73             CCFContextDataObject& aData );
       
    74     static CCFPublishContextCmd* NewLC( CCFContextManager& aContextManager,
       
    75             const CCFContextObject& aContext,
       
    76             CCFContextDataObject& aData );
       
    77 
       
    78     /**
       
    79      * C++ destructor.
       
    80      */
       
    81     virtual ~CCFPublishContextCmd();
       
    82 
       
    83 public: // From CCFCmd
       
    84 
       
    85     /**
       
    86      * Executes the publish context command.
       
    87      *
       
    88      * @since S60 5.0
       
    89      * @param None.
       
    90      * @return None.
       
    91      */
       
    92     virtual void ExecuteL();
       
    93 
       
    94     /**
       
    95      * Logs the error using error trace macros.
       
    96      *
       
    97      * @since S60 5.0
       
    98      * @param aError is the leave code from a call to ExecuteL.
       
    99      * @return None.
       
   100      */
       
   101     virtual void LogError( TInt aError );
       
   102 
       
   103 private:
       
   104 
       
   105     CCFPublishContextCmd( CCFContextManager& aContextManager );
       
   106     void ConstructL( const CCFContextObject& aContext );
       
   107     void ConstructL( const CCFContextObject& aContext,
       
   108             CCFContextDataObject& aData );
       
   109 
       
   110 private: // Data
       
   111 
       
   112     // Context manager handling context publications.
       
   113     CCFContextManager& iContextManager;
       
   114 
       
   115     // Context published by this command; owned.
       
   116     CCFContextObject* iContextObject;
       
   117 
       
   118     // Context data; owned, optional: NULL = no data.
       
   119     CCFContextDataProxy* iData;
       
   120     };
       
   121 
       
   122 #endif // C_CFPUBLISHCONTEXTCMD_H