activityfw/activitydatabase/hsactivitydbserver/inc/activitysession.h
changeset 73 4bc7b118b3df
child 83 156f692b1687
equal deleted inserted replaced
66:32469d7d46ff 73:4bc7b118b3df
       
     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 ACTIVITYSESSION_H
       
    18 #define ACTIVITYSESSION_H
       
    19 
       
    20 #ifndef __E32SVR_H__
       
    21 #define __E32SVR_H__
       
    22 #endif 
       
    23 // INCLUDES
       
    24 #include <e32std.h>
       
    25 #include <e32base.h>
       
    26 #include <f32file.h>
       
    27 
       
    28 #include "activitytaskstorage.h"
       
    29 
       
    30 class CActivityStorage;
       
    31 /**
       
    32  *  CActivitySession
       
    33  * 
       
    34  */
       
    35 class CActivitySession : public CSession2,
       
    36                          public MActivityTaskStorage
       
    37 {
       
    38 public:
       
    39     // Constructors and destructor
       
    40 
       
    41     /**
       
    42      * Destructor.
       
    43      */
       
    44     ~CActivitySession();
       
    45 
       
    46     /**
       
    47      * Two-phased constructor.
       
    48      * @param fileSession - initialized file system session
       
    49      * @param taskStorage - global observers storage
       
    50      * @param storage - data storage
       
    51      */
       
    52     static CActivitySession* NewL(RFs& fileSession,
       
    53                                   MActivityTaskStorage& taskStorage, 
       
    54                                   CActivityStorage&storage);
       
    55 
       
    56 public:
       
    57     /**
       
    58      * Interface implementation
       
    59      * @see MActivityTaskStorage::PushL(CActivityTask *)
       
    60      */
       
    61     void PushL(CActivityTask *);
       
    62     
       
    63     /**
       
    64      * Interface implementation
       
    65      * @see MActivityTaskStorage::Pop(CActivityTask *)
       
    66      */
       
    67     void Pop(CActivityTask *);
       
    68     
       
    69     /**
       
    70      * Interface implementation
       
    71      * @see MActivityTaskStorage::StorageData()
       
    72      */
       
    73     const RPointerArray<CActivityTask>& StorageData() const;
       
    74 private:
       
    75 
       
    76     /**
       
    77      * Constructor for performing 1st stage construction
       
    78      * @param fileSession - initialized file system session
       
    79      * @param taskStorage - global observers storage
       
    80      * @param storage - data storage
       
    81      */
       
    82     CActivitySession(RFs& fileSession,
       
    83                      MActivityTaskStorage& taskStorage, 
       
    84                      CActivityStorage& storage);
       
    85 
       
    86     /**
       
    87      * EPOC default constructor for performing 2nd stage construction
       
    88      */
       
    89     void ConstructL();
       
    90 
       
    91 private:
       
    92     /**
       
    93      * Implements interface
       
    94      * @see void CSession2::ServiceL(const RMessage2&)
       
    95      */
       
    96     void ServiceL(const RMessage2& message);
       
    97 
       
    98 private:
       
    99     RFs& mFileSession; 
       
   100     MActivityTaskStorage& mTasksStorage;
       
   101     CActivityStorage& mStorage;
       
   102     RPointerArray<CActivityTask> mRunningTasks;
       
   103 };
       
   104 
       
   105 #endif // ACTIVITYSESSION_H