multimediacommsengine/tsrc/MCETestUI/inc/CMCETestUIEventViewContainer.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     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 
       
    18 #ifndef EVENTVIEWCONTAINER_H
       
    19 #define EVENTVIEWCONTAINER_H
       
    20 
       
    21 // INCLUDES
       
    22 
       
    23 #include <aknlists.h>
       
    24 #include <coecntrl.h>
       
    25 #include <eiklbo.h>  // MListBoxObserver
       
    26 
       
    27 //#include "UINotify.h"
       
    28 
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class CAknView;
       
    32 class CMCETestUIEngine;
       
    33 class CMCETestUIEngineEvent;
       
    34 class CMCETestUIEventViewModel;
       
    35 class CMCETestUIEventView;
       
    36 
       
    37 
       
    38 // CLASS DECLARATION
       
    39 
       
    40 /**
       
    41 *  CMCETestUIEventViewContainer  container control class.
       
    42 *  
       
    43 */
       
    44 class CMCETestUIEventViewContainer : public CCoeControl, MCoeControlObserver,
       
    45 										public MEikListBoxObserver
       
    46 {
       
    47 public: // Constructors and destructor
       
    48     
       
    49     static CMCETestUIEventViewContainer* NewL( 
       
    50         const TRect& aRect, 
       
    51         CMCETestUIEventView& aOwningView,
       
    52         CMCETestUIEngine& aEngine,
       
    53         CMCETestUIEngineEvent& aEvent );
       
    54     
       
    55     /**
       
    56     * Destructor.
       
    57     */
       
    58     ~CMCETestUIEventViewContainer();
       
    59     
       
    60 public: // New functions
       
    61 
       
    62     void ConstructModelL();
       
    63         
       
    64 private: // Constructors 
       
    65 
       
    66     CMCETestUIEventViewContainer( CMCETestUIEventView& aOwningView, 
       
    67                                  CMCETestUIEngine& aEngine,
       
    68                                  CMCETestUIEngineEvent& aEvent );
       
    69 
       
    70     /**
       
    71     * @param aRect Frame rectangle for container.
       
    72     */
       
    73     void ConstructL(const TRect& aRect);
       
    74         
       
    75 private: // Functions from base classes
       
    76     
       
    77     /**
       
    78     * From CoeControl. Calls SizeChangedL with TRAP.
       
    79     */
       
    80     void SizeChanged();  
       
    81     
       
    82     /**
       
    83     * Handle change of control size
       
    84     */
       
    85     void SizeChangedL();
       
    86     
       
    87     /**
       
    88     * From CoeControl.
       
    89     */
       
    90     TInt CountComponentControls() const;
       
    91     
       
    92     /**
       
    93     * From CCoeControl.
       
    94     */
       
    95     CCoeControl* ComponentControl(TInt aIndex) const;
       
    96     
       
    97     /**
       
    98     * Event handling section, e.g Listbox events.
       
    99     */
       
   100     void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
       
   101     
       
   102     void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);
       
   103 
       
   104     /**
       
   105     * From CCoeControl,Draw.
       
   106     */
       
   107     void Draw(const TRect& aRect) const;
       
   108     
       
   109     /**
       
   110     * Key event handler. Handles up and down arrow keys, so that
       
   111     * output window can be scrolled.
       
   112     */
       
   113     TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
       
   114 
       
   115 public: // convenience functions
       
   116 
       
   117     void DoShowMenuL();
       
   118 
       
   119 
       
   120     
       
   121 private: //data
       
   122 
       
   123 	CAknDoubleStyleListBox* iListBox; // owned
       
   124 	CMCETestUIEventViewModel* iListBoxModel; // ownership is given to iListBox
       
   125 
       
   126     CMCETestUIEventView& iOwningView; 
       
   127     CMCETestUIEngine& iEngine;
       
   128     CMCETestUIEngineEvent& iEvent;
       
   129     
       
   130     TBool iContextMenuAlreadyShown;
       
   131 
       
   132     };
       
   133     
       
   134 #endif
       
   135     
       
   136     // End of File