locationsystemui/locationsysui/privacyverifiernotifierui/locprivacyserver/inc/locprivacyserver.h
branchRCL_3
changeset 44 2b4ea9893b66
equal deleted inserted replaced
42:02ba3f1733c6 44:2b4ea9893b66
       
     1 /*
       
     2 * Copyright (c) 2010 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:  server class definition.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CLOCPRIVACYSERVER_H
       
    19 #define CLOCPRIVACYSERVER_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <e32base.h>
       
    23 #include <locprivacyinternal.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 
       
    27 class CLocPrivacyServerSession;
       
    28 
       
    29 // CLASS DECLARATION
       
    30 
       
    31 /**
       
    32  *  The main server side class.
       
    33  */
       
    34 class CLocPrivacyServer : public CServer2
       
    35     {
       
    36 public:
       
    37     // Constructors and destructor
       
    38 
       
    39     /**
       
    40      * Two-phased constructor.
       
    41      */
       
    42     static CLocPrivacyServer* NewL();
       
    43 
       
    44     /**
       
    45      * Destructor.
       
    46      */
       
    47     ~CLocPrivacyServer();
       
    48 
       
    49 private:
       
    50 
       
    51     /**
       
    52      * C++ constructor.
       
    53      *
       
    54      * @param aPriority Priority at which to run the server active object.
       
    55      */
       
    56     CLocPrivacyServer(
       
    57     /* IN  */TInt aPriority);
       
    58 
       
    59     /**
       
    60      * EPOC default constructor.
       
    61      */
       
    62     void ConstructL();
       
    63 
       
    64 public:
       
    65     // New functions
       
    66 
       
    67     // Server priority. 950 is standard value.
       
    68     enum
       
    69         {
       
    70         EPriority = 950
       
    71         };
       
    72 
       
    73     /**
       
    74      * Increment number of sessions.
       
    75      */
       
    76     void IncrementSessions();
       
    77 
       
    78     /**
       
    79      * Decrement number of sessions.
       
    80      *
       
    81      * @param aSession Pointer to session that is calling
       
    82      *                 DecrementSessions().It will be used in future.
       
    83      */
       
    84     void DecrementSessions(
       
    85     /* IN  */CLocPrivacyServerSession* /*aSession */);
       
    86 
       
    87 public:
       
    88     // Functions from base classes
       
    89 
       
    90     /**
       
    91      * From CServer.
       
    92      *
       
    93      * @param aVersion the server version.
       
    94      * @param aMessage The connect message from the client.
       
    95      * @return a new session
       
    96      */
       
    97     CSession2* NewSessionL(
       
    98     /* IN  */const TVersion& aVersion,
       
    99     /* IN  */const RMessage2& aMessage) const;
       
   100 
       
   101     /**
       
   102      * From CActive.
       
   103      *
       
   104      * @param aError the error code of the server leave.
       
   105      * @return always KErrNone.
       
   106      */
       
   107     TInt RunError(
       
   108     /* IN  */TInt aError);
       
   109 
       
   110 private:
       
   111 
       
   112     // By default, prohibit copy constructor
       
   113     CLocPrivacyServer(const CLocPrivacyServer&);
       
   114     // Prohibit assigment operator
       
   115     CLocPrivacyServer& operator=(const CLocPrivacyServer&);
       
   116 
       
   117 private:
       
   118     // Data
       
   119     TInt iNumSessions;
       
   120     };
       
   121 
       
   122 #endif      // CLOCPRIVACYSERVER_H
       
   123 // End of File
       
   124