menucontentsrv/srvinc/menusrv.h
changeset 0 79c6a41cd166
equal deleted inserted replaced
-1:000000000000 0:79c6a41cd166
       
     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 
       
    18 #ifndef __MENUSRV_H__
       
    19 #define __MENUSRV_H__
       
    20 
       
    21 //  INCLUDES
       
    22 
       
    23 #include <e32base.h>
       
    24 #include <eikenv.h>
       
    25 #include <eikappui.h>
       
    26 #include "menuengobserver.h"
       
    27 
       
    28 // FORWARD DECLARATION
       
    29 
       
    30 class CMenuSrvEng;
       
    31 class CTimeout;
       
    32 
       
    33 // GLOBAL FUNCTIONS
       
    34 
       
    35 /**
       
    36 * Run the Menu Server (entry function).
       
    37 * @return Error code.
       
    38 */
       
    39 IMPORT_C TInt RunMenuServer();
       
    40 
       
    41 // CLASS DECLARATION
       
    42 
       
    43 /**
       
    44 * Menu Server.
       
    45 */
       
    46 NONSHARABLE_CLASS( CMenuSrv ) : public CPolicyServer
       
    47     {
       
    48 public:     // Constructor
       
    49 
       
    50     /**
       
    51     * Destructor.
       
    52     */
       
    53     virtual ~CMenuSrv();
       
    54 
       
    55     /**
       
    56     * Two-phased constructor. Leaves on failure.
       
    57     * @return The constructed server.
       
    58     */
       
    59     static CMenuSrv* NewL();
       
    60 
       
    61 public:     // New methods
       
    62 
       
    63     /**
       
    64     * Creates the object container.
       
    65     * @param -
       
    66     * @return A pointer to the newly created CObjectCon.
       
    67     */
       
    68     CObjectCon* NewContainerL();
       
    69 
       
    70     /**
       
    71     * Removes the specified object container from this container index 
       
    72     * and deletes it.
       
    73     * @param aCon A pointer to the object container to be removed.
       
    74     * @return None.
       
    75     */
       
    76     void RemoveContainer( CObjectCon* aCon );
       
    77 
       
    78     /**
       
    79     * Get a new shared engine with this name. Owner is the caller.
       
    80     * The returned object should be Close()-d, not deleted!
       
    81     * @param aName Content file name.
       
    82     * @return Shared Engine.
       
    83     */
       
    84     CMenuSrvEng* GetEngineL( const TDesC& aName );
       
    85 
       
    86     /**
       
    87     * A shared engine is deleted.
       
    88     * When the last engine is deleted, we can exit.
       
    89     */
       
    90     void EngineDeleted();
       
    91 
       
    92 private:    // Constructors and destructor
       
    93 
       
    94     /**
       
    95     * Constructor.
       
    96     */
       
    97     CMenuSrv();
       
    98 
       
    99     /**
       
   100     * Second-phase constructor.
       
   101     */
       
   102     void ConstructL();
       
   103 
       
   104 private:    // From CServer2
       
   105 
       
   106     /**
       
   107     * Create new session.
       
   108     * @param aVersion Version.
       
   109     * @param aMessage Message (unused).
       
   110     * @return New session.
       
   111     */
       
   112     CSession2* NewSessionL
       
   113         ( const TVersion& aVersion, const RMessage2& aMessage ) const;
       
   114     
       
   115     /** 
       
   116     * Performs a custom security check.
       
   117     * @param aMsg The message to check.
       
   118     * @param aAction A reference to the action to take if the security
       
   119     * check fails.
       
   120     * @param aMissing A reference to the list of security attributes missing
       
   121     * from the checked process.
       
   122     * @return A value from TCustomResult.
       
   123     */
       
   124     TCustomResult CustomSecurityCheckL(
       
   125         const RMessage2& aMsg, 
       
   126         TInt& aAction,
       
   127         TSecurityInfo& aMissing );
       
   128     
       
   129 
       
   130 
       
   131 private:    // Data
       
   132 
       
   133     CTimeout* iExitTimer; ///< Exit timer. Own.
       
   134     CObjectConIx* iObjectConIx; ///< Container index. Own.
       
   135     CObjectCon* iEngines; ///< Engines. Own.
       
   136 
       
   137 };
       
   138 
       
   139 #endif // __MENUSRV_H__
       
   140 
       
   141 // End of File