sdkcreationmw/sdkruntimes/GuiLauncher/inc/EcmtGuiLogContainer.h
author Shabe Razvi <shaber@symbian.org>
Thu, 04 Nov 2010 17:22:05 +0000
changeset 4 b3b823debf08
parent 0 b26acd06ea60
permissions -rw-r--r--
Workaround for Bug 3917 - CWinsockInterface::DataSent calls NotifyDataSent which is not implemented.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     1
/*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     2
* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     3
* All rights reserved.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     4
* This component and the accompanying materials are made available
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     6
* which accompanies this distribution, and is available
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     8
*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     9
* Initial Contributors:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    11
*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    12
* Contributors:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    13
*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    14
* Description:  Container class for log view.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    15
*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    16
*/
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    17
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    18
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    19
#ifndef __ECMTGUI_LOGCONTAINER_H__
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    20
#define __ECMTGUI_LOGCONTAINER_H__
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    21
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    22
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    23
#include <aknlists.h>
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    24
#include <coecntrl.h>
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    25
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    26
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    27
/**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    28
 *  View class for the LogContainer.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    29
 *
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    30
 *  @since S60 v3.1
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    31
 */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    32
class CEcmtGuiLogContainer : public CCoeControl
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    33
    {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    34
        
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    35
public: 
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    36
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    37
    /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    38
     * C++ default constructor.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    39
     */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    40
  	CEcmtGuiLogContainer( CDesCArrayFlat& aMessageList );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    41
  	
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    42
  	/**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    43
     * Destructor.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    44
     */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    45
  	~CEcmtGuiLogContainer();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    46
  	
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    47
  	/**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    48
     * Symbian 2nd phase constructor.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    49
     */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    50
    void ConstructL(const TRect& aRect );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    51
	
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    52
		/**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    53
     * Two-phased constructor.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    54
     */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    55
    static CEcmtGuiLogContainer* NewL(const TRect& aRect );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    56
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    57
    
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    58
private: // From CCoeControl
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    59
           
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    60
    /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    61
     * From CoeControl.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    62
     * Responds to changes to the size and position of the contents of this 
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    63
     * control.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    64
     */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    65
    void SizeChanged();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    66
    
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    67
    /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    68
     * From CoeControl.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    69
     * Gets the number of controls contained in a compound control.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    70
     *
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    71
     * @return The number of component controls contained by this control.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    72
     */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    73
    TInt CountComponentControls() const;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    74
    
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    75
    /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    76
     * From CoeControl.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    77
     * Gets an indexed component of a compound control.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    78
     *
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    79
     * @param aIndex The index of the control.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    80
     * @return The component control with an index of aIndex.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    81
     */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    82
    CCoeControl* ComponentControl(TInt aIndex) const;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    83
    
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    84
    /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    85
     * From CoeControl.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    86
     * Draws the control.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    87
     *
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    88
     * @param aRect The region of the control to be redrawn.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    89
     */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    90
    void Draw(const TRect& /*aRect*/) const;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    91
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    92
public: // New functions
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    93
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    94
    /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    95
     * Clears logs from the listbox.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    96
     */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    97
    void ClearMessageListL();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    98
    
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    99
    /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   100
     * Adds message to the listbox and to the message list iMessageList.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   101
     *
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   102
     * @param aText Message to the listbox.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   103
     * @param aAutoScroll Autoscroll listbox after appending message.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   104
     */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   105
    void AddMessageL(const TDesC& aText, TBool aAutoScroll);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   106
    
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   107
    /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   108
     * Calls AddMessageL
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   109
     *
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   110
     * @param aMsg Message.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   111
     */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   112
    void LogMessageL( const TDesC& aMsg );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   113
    
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   114
    /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   115
     * Loads message from resource and calls AddMessageL.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   116
     *
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   117
     * @param aMsgResId Message resource Id.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   118
     */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   119
    void LogMessageL( TInt aMsgResId );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   120
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   121
private: // Data
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   122
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   123
    /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   124
     * Listbox control.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   125
     * Own.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   126
     */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   127
    CAknDoubleStyleListBox* iListBox;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   128
    
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   129
    /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   130
     * Max length for message.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   131
     */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   132
    enum { KMaxLogMsgLen = 128 };
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   133
    
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   134
    /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   135
     * Buffer for storing last log message.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   136
     */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   137
    TBuf<KMaxLogMsgLen> iLastMsg;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   138
    
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   139
    /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   140
     * Boolean indicating is listbox automatically scrollable.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   141
     */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   142
    TBool iAutoScroll;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   143
    
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   144
    /**
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   145
     * A reference to message list, which is owned by the log view class.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   146
     */
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   147
    CDesCArrayFlat& iMessageList;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   148
    };
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   149
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   150
#endif // __ECMTGUI_LOGCONTAINER_H__