calendarui/views/inc/calenpreviewlayoutmanager.h
changeset 0 f979ecb2b13e
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     1 /*
       
     2 * Copyright (c) 2002 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:   The model part of popup.
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CALENPREVIEWLAYOUTMANAGER_H
       
    21 #define CALENPREVIEWLAYOUTMANAGER_H
       
    22 
       
    23 #include "CalendarVariant.hrh"
       
    24 
       
    25 #include "calenpreviewlabel.h"
       
    26 
       
    27 #include <coelayoutman.h>
       
    28 #include <AknUtils.h>
       
    29 
       
    30 class MCoeLayoutManager;
       
    31 class CCoeControl;
       
    32 class CCalenPreview;
       
    33 //class CCalenPreviewLabel;
       
    34 
       
    35 class TAknLayoutRect;
       
    36 class TAknTextLineLayout;
       
    37 class CFont;
       
    38 
       
    39 NONSHARABLE_CLASS( CCalenPreviewLayoutManager ) : public MCoeLayoutManager
       
    40     {
       
    41     public:
       
    42     static CCalenPreviewLayoutManager* NewL(CCalenPreview* aPreview);
       
    43     ~CCalenPreviewLayoutManager();
       
    44 
       
    45     private:
       
    46     void ConstructL();
       
    47     CCalenPreviewLayoutManager(CCalenPreview* aPreview);
       
    48 
       
    49     public:
       
    50     // Member functions from MCoeLayoutManager
       
    51     void AttachL(CCoeControl &aCompoundControl);
       
    52     void Detach(CCoeControl &aCompoundControl);
       
    53     void PerformLayout();
       
    54     void HandleAddedControlL(const CCoeControl &aCompoundControl,
       
    55                              const CCoeControl &aAddedControl);
       
    56     void HandleRemovedControl(const CCoeControl &aCompoundControl,
       
    57                               const CCoeControl &aRemovedControl);
       
    58     void SetTextBaselineSpacing(TInt aBaselineSpacing);
       
    59     TBool CanAttach() const;
       
    60     TSize CalcMinimumSize(const CCoeControl &aCompoundControl) const;
       
    61     TInt TextBaselineSpacing() const;
       
    62     TInt HandleControlReplaced(const CCoeControl &aOldControl,
       
    63                                const CCoeControl &aNewControl);
       
    64     TInt CalcTextBaselineOffset(const CCoeControl &aCompoundControl,
       
    65                                 const TSize &aSize) const;
       
    66 
       
    67     public:
       
    68     // New member functions
       
    69     TBool UsePreview();
       
    70     TRect ReducePreview(TRect aRect);
       
    71     TSize MinimumSize();
       
    72     void SetLinesUsed(TInt aLinesUsed);
       
    73     void SetContainerLayout();
       
    74     TInt LineCount();
       
    75     TInt LastLineWidth() const;
       
    76     TInt EmptyLineWidth() const;
       
    77     TInt TitleLineWidth() const;
       
    78     TInt FirstLineWidth() const;
       
    79     TInt MiddleLineWidth() const;
       
    80     TInt PluginLineWidth() const;
       
    81     const CFont* LineFont()const;
       
    82     const CFont* TitleFont()const;
       
    83     const CFont* PluginFont()const;
       
    84     
       
    85     TInt Orientation();
       
    86     
       
    87     
       
    88     
       
    89     void LayoutPluginControlL(CCoeControl& aControl);
       
    90 
       
    91     private:
       
    92     void PerformPopupLayout();
       
    93     void PerformPreviewLayout();
       
    94     void UpdateLayoutData();
       
    95     TRect StatusPane();
       
    96     TRect ApplicationWindow();
       
    97 
       
    98     private:
       
    99     TInt iLinesUsed;
       
   100     CCoeControl* iContainer; // not owned
       
   101     TAknLayoutText iTitleLine;
       
   102     TAknLayoutText iFirstLine;
       
   103     TAknLayoutText iMiddleLine;
       
   104     TAknLayoutText iLastLine;
       
   105     TAknLayoutText iEmptyLine;
       
   106     TAknLayoutText iPluginLine;
       
   107     CCalenPreview*  iPreview;
       
   108     };
       
   109 
       
   110 
       
   111 #endif // CALENPREVIEWLAYOUTMANAGER_H