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