activityfw/activitydatabase/hsactivitydbserver/inc/activityserver.h
changeset 103 b99b84bcd2d1
parent 83 156f692b1687
child 104 9b022b1f357c
equal deleted inserted replaced
83:156f692b1687 103:b99b84bcd2d1
     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 #ifndef ACTIVITYSERVER_H
       
    18 #define ACTIVITYSERVER_H
       
    19 
       
    20 #define __E32SVR_H__
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32std.h>
       
    24 #include <e32base.h>
       
    25 #include <f32file.h>    // RFs
       
    26 
       
    27 #include "activitytaskstorage.h"
       
    28 
       
    29 class CActivityStorage;
       
    30 /**
       
    31  *  CActivityServer
       
    32  * 
       
    33  */
       
    34 class CActivityServer : public CServer2,
       
    35                         public MActivityTaskStorage
       
    36 {
       
    37 public:
       
    38     /**
       
    39      * Destructor.
       
    40      */
       
    41     ~CActivityServer();
       
    42 
       
    43     /**
       
    44      * Two-phased constructor.
       
    45      */
       
    46     static CActivityServer* NewLC();
       
    47 
       
    48 public:
       
    49     /**
       
    50      * Interface implementation
       
    51      * @see MActivityTaskStorage::PushL(CActivityTask *)
       
    52      */
       
    53     void PushL(CActivityTask *);
       
    54     
       
    55     /**
       
    56      * Interface implementation
       
    57      * @see MActivityTaskStorage::Pop(CActivityTask *)
       
    58      */
       
    59     void Pop(CActivityTask *);
       
    60     
       
    61     /**
       
    62      * Interface implementation
       
    63      * @see MActivityTaskStorage::StorageData()
       
    64      */
       
    65     const RPointerArray<CActivityTask>& StorageData() const;
       
    66     
       
    67 
       
    68 private:
       
    69 
       
    70     /**
       
    71      * Constructor for performing 1st stage construction
       
    72      */
       
    73     CActivityServer();
       
    74 
       
    75     /**
       
    76      * Default constructor for performing 2nd stage construction
       
    77      */
       
    78     void ConstructL();
       
    79 
       
    80     /**
       
    81      * Interface implementation
       
    82      * @see CServer2::NewSessionL(const TVersion&, const RMessage2&)
       
    83      */
       
    84     CSession2* NewSessionL(const TVersion& version, const RMessage2& message) const;
       
    85     
       
    86     /**
       
    87      * Removes not valid task
       
    88      */
       
    89     void RemoveNotValidTasks(const CSession2* session);
       
    90     
       
    91 private:
       
    92     RFs mFsSession;
       
    93     CActivityStorage* mStorage;
       
    94     RPointerArray<CActivityTask> mObservers;
       
    95 };
       
    96 
       
    97 #endif // ACTIVITYSERVER_H