camerauis/cameraxui/cxui/inc/cxuieventlog.h
branchRCL_3
changeset 24 bac7acad7cb3
parent 23 61bc0f252b2b
child 25 2c87b2808fd7
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
     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:
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CXUIEVENTLOG_H
       
    19 #define CXUIEVENTLOG_H
       
    20 
       
    21 #include <QString>
       
    22 #include <QTime>
       
    23 #include <QLinkedList>
       
    24 
       
    25 /*!
       
    26 * Class for saving events in run-time to be printed / traced out later.
       
    27 * Useful when tracing is not possible when the events occur, but can be done later.
       
    28 */
       
    29 class CxuiEventLog
       
    30 {
       
    31 public:
       
    32     CxuiEventLog(const QString &name, int size = 10);
       
    33     ~CxuiEventLog();
       
    34 
       
    35     void append(const QString &type, const QString &value);
       
    36     void print() const;
       
    37 
       
    38 private:
       
    39     struct CxuiEvent
       
    40     {
       
    41     public:
       
    42         CxuiEvent(const QString &type, const QString &value);
       
    43 
       
    44         QTime mTime;
       
    45         QString mType;
       
    46         QString mValue;
       
    47     };
       
    48 
       
    49     QLinkedList<CxuiEvent> mEvents;
       
    50     int mSize;
       
    51     QString mName;
       
    52 };
       
    53 
       
    54 #endif // CXUIEVENTLOG_H