defaultapplicationsettings/server/inc/das_service.h
branchRCL_3
changeset 13 90fe62538f66
parent 12 3fec62e6e7fc
child 14 5f281e37a2f5
equal deleted inserted replaced
12:3fec62e6e7fc 13:90fe62538f66
     1 /*
       
     2 * Copyright (c) 2005-2006 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:  The Default App Service implementation (server-side)
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_DEFAULTAPPSERVICE_H
       
    21 #define C_DEFAULTAPPSERVICE_H
       
    22 
       
    23 #include <AknServerApp.h>
       
    24 
       
    25 class CDefaultAppServer;
       
    26 
       
    27 /**
       
    28  *  This class implements the Default Application server-side service.
       
    29  *
       
    30  *  @since Series 60 v5.0
       
    31  */
       
    32 class CDefaultAppService : public CAknAppServiceBase
       
    33     {
       
    34 public:
       
    35     enum TIpcMessageIds
       
    36         {
       
    37         ESetDefaultAll = RApaAppServiceBase::KServiceCmdBase
       
    38         };
       
    39         
       
    40     /**
       
    41      * Symbian OS two-phased constructor
       
    42      * @return
       
    43      */    
       
    44     static CDefaultAppService* NewL(const CDefaultAppServer* aServer);
       
    45     
       
    46     /**
       
    47      * Destructor.
       
    48      */
       
    49     virtual ~CDefaultAppService();
       
    50     
       
    51 public: // from base class CAknAppServiceBase  
       
    52 
       
    53     /**
       
    54      * From CAknAppServiceBase.
       
    55      * function called when a new message is received
       
    56      *
       
    57      * @since S60 v5.0
       
    58      * @param aMessage the received service message
       
    59      */
       
    60     void ServiceL(const RMessage2& aMessage);        
       
    61     
       
    62     /**
       
    63      * From CAknAppServiceBase.
       
    64      * function called to check client credentials. Used to retrieve client app UID
       
    65      *
       
    66      * @since S60 v5.0
       
    67      * @param aMsg the message being received
       
    68      */
       
    69     CPolicyServer::TCustomResult SecurityCheckL(const RMessage2& aMsg, TInt& aAction, TSecurityInfo& aMissing);
       
    70 
       
    71 private: //construction
       
    72 
       
    73     /**
       
    74      * C++ constructor.
       
    75      */
       
    76     CDefaultAppService(const CDefaultAppServer* aServer);
       
    77     
       
    78     /**
       
    79      * Sets default for all the Service & MIME pairs supported by the client
       
    80      *
       
    81      * @since S60 v5.0
       
    82      * @param aMessage the received service message
       
    83      */
       
    84     void HandleSetDefaultAllL(const RMessage2& aMessage);
       
    85     
       
    86     /**
       
    87      * Function where most of the processing happens.
       
    88      * We use it so that the service request from the client returns immediately
       
    89      *
       
    90      * @since S60 v5.0
       
    91      * @param aInstance a pointer to the calling CDefaultAppService instance  
       
    92      */
       
    93     static TInt IdleWorker(TAny *aInstance);
       
    94     
       
    95 public:
       
    96     /**
       
    97      * The Uid of the client application
       
    98      */
       
    99     TUid iClientUid;
       
   100     
       
   101     /**
       
   102      * Service flags requested by the client
       
   103      */
       
   104     TInt iServiceFlags;
       
   105     
       
   106     /**
       
   107      * pointer to the server
       
   108      * Not owned.
       
   109      */
       
   110     const CDefaultAppServer* iDefaultAppServer;  //not owned
       
   111     
       
   112     /**
       
   113      * Active Object where most of the processing happens. We use it so that the service
       
   114      * call returns immediately.
       
   115      * Owned.
       
   116      */
       
   117     CIdle *iIdle;
       
   118     };
       
   119 
       
   120 #endif      // C_DEFAULTAPPSERVICE_H
       
   121 
       
   122 // End of File