logsui/logsengine/logssymbianos/inc/logsreaderstatecontext.h
changeset 14 f27aebe284bb
parent 0 4a5361db8937
equal deleted inserted replaced
11:64a47b97e1e1 14:f27aebe284bb
    22 #include <QList>
    22 #include <QList>
    23 #include <QHash>
    23 #include <QHash>
    24 
    24 
    25 // FORWARD DECLARATION
    25 // FORWARD DECLARATION
    26 class LogsReaderStateBase;
    26 class LogsReaderStateBase;
    27 class CLogView;
       
    28 class CLogViewDuplicate;
       
    29 class CLogViewEvent;
       
    30 class LogsEvent;
    27 class LogsEvent;
    31 class LogsEventStrings;
    28 class LogsEventStrings;
    32 class TRequestStatus;
       
    33 class LogsReaderObserver;
    29 class LogsReaderObserver;
    34 class CLogClient;
       
    35 
    30 
    36 // CLASS DECLARATION
    31 // CLASS DECLARATION
    37 
    32 
    38 class ContactCacheEntry 
    33 class ContactCacheEntry 
    39 {
    34 {
    43     inline ContactCacheEntry(QString remoteParty, unsigned int contactId);
    38     inline ContactCacheEntry(QString remoteParty, unsigned int contactId);
    44     
    39     
    45     QString mRemoteParty;
    40     QString mRemoteParty;
    46     unsigned int mContactLocalId;
    41     unsigned int mContactLocalId;
    47 };
    42 };
    48         
       
    49 
    43 
    50 /**
    44 /**
    51  * Context for reader state machine
    45  * Context for reader state machine
    52  */
    46  */
    53 class LogsReaderStateContext {
    47 class LogsReaderStateContext {
    54     public:
    48     public:
    55         
    49         
    56         /**
    50         /**
    57          * Change state
       
    58          * @param state, new state
       
    59          */
       
    60         virtual void setCurrentState(const LogsReaderStateBase& state) = 0;
       
    61         
       
    62         /**
       
    63          * Get log view
       
    64          * @return current log view
       
    65          */
       
    66         virtual CLogView& logView() = 0;
       
    67         
       
    68         /**
       
    69          * Get duplicates view
       
    70          * @return current duplicates view
       
    71          */
       
    72         virtual CLogViewDuplicate& duplicatesView() = 0;
       
    73         
       
    74         /**
       
    75          * Get event container
    51          * Get event container
    76          * @return events
    52          * @return events
    77          */
    53          */
    78         virtual QList<LogsEvent*>& events() = 0;
    54         virtual QList<LogsEvent*>& events() = 0;
    79         
    55         
    80         /**
    56         /**
    81          * Get view index
       
    82          * @return ref to view index
       
    83          */
       
    84         virtual int& index() = 0;
       
    85         
       
    86         /**
       
    87          * Get commonly used strings
    57          * Get commonly used strings
    88          * @return strings
    58          * @return strings
    89          */
    59          */
    90         virtual LogsEventStrings& strings() = 0;
    60         virtual LogsEventStrings& strings() = 0;
    91         
    61 
    92         /**
       
    93          * Request status for async operations
       
    94          * inside states
       
    95          * @return reqstatus
       
    96          */
       
    97         virtual TRequestStatus& reqStatus() = 0;
       
    98         
       
    99         /**
    62         /**
   100          * Get observer
    63          * Get observer
   101          * @return observer
    64          * @return observer
   102          */
    65          */
   103         virtual LogsReaderObserver& observer() = 0;
    66         virtual LogsReaderObserver& observer() = 0;
   105         /**
    68         /**
   106          * Get contact cache
    69          * Get contact cache
   107          * @return cache (key:telnum, value:contactname)
    70          * @return cache (key:telnum, value:contactname)
   108          */
    71          */
   109         virtual QHash<QString, ContactCacheEntry>& contactCache() = 0;
    72         virtual QHash<QString, ContactCacheEntry>& contactCache() = 0;
   110         
       
   111         /**
       
   112          * Get ID of the event to be handled
       
   113          * @return ID of the event
       
   114          */
       
   115         virtual int currentEventId() = 0;
       
   116         
       
   117         /**
       
   118          * Get log client
       
   119          * @return log client
       
   120          */
       
   121         virtual CLogClient& logClient() = 0;
       
   122         
       
   123         /**
       
   124          * Check if current view is recent view.
       
   125          * @return true if recent view
       
   126          */
       
   127         virtual bool isRecentView() = 0;
       
   128         
    73         
   129         /**
    74         /**
   130          * Get event container for duplicated events
    75          * Get event container for duplicated events
   131          * @return duplicated events
    76          * @return duplicated events
   132          */
    77          */