textinput/peninputcommonctrls/inc/peninputdropdownlist/peninputdropdownlistcontext.h
changeset 40 2cb9bae34d17
parent 31 f1bdd6b078d1
child 49 37f5d84451bd
equal deleted inserted replaced
31:f1bdd6b078d1 40:2cb9bae34d17
     1 /*
       
     2 * Copyright (c) 2002-2005 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:  context for list
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef M_DROP_DOWN_LIST_CONTEXT_H
       
    20 #define M_DROP_DOWN_LIST_CONTEXT_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <w32std.h>
       
    24 #include <AknsDrawUtils.h> 
       
    25 
       
    26 class CCandidate;
       
    27 class CPages;
       
    28 class CBitmapDb;
       
    29 class CList;
       
    30 
       
    31 struct TDropdownListDrawInfo
       
    32     {
       
    33     TAknsItemID iInactiveBtnImgID;
       
    34     TAknsItemID iNormalBtnImgID;
       
    35     TAknsItemID iPressedBtnImgID;
       
    36 
       
    37     TAknsItemID iCandidateLeftImgID;
       
    38     TAknsItemID iCandidateMiddleImgID;
       
    39     TAknsItemID iCandidateRightImgID;
       
    40     
       
    41     TAknsItemID iCandidatePressedLeftImgID;
       
    42     TAknsItemID iCandidatePressedMiddleImgID;
       
    43     TAknsItemID iCandidatePressedRightImgID;
       
    44     
       
    45     TRgb iCandidatesHighlightColor;
       
    46     
       
    47     TBool iSupportSkin;
       
    48     
       
    49     TDropdownListDrawInfo(TAknsItemID aInactiveBtnImgID,
       
    50                           TAknsItemID aNormalBtnImgID,
       
    51                           TAknsItemID aPressedBtnImgID,
       
    52                           
       
    53                           TAknsItemID aCandidateLeftImgID,
       
    54                           TAknsItemID aCandidateMiddleImgID,
       
    55                           TAknsItemID aCandidateRightImgID,
       
    56                       
       
    57                           TAknsItemID aCandidatePressedLeftImgID,
       
    58                           TAknsItemID aCandidatePressedMiddleImgID,
       
    59                           TAknsItemID aCandidatePressedRightImgID,
       
    60 
       
    61                           TRgb aCandidatesHighlightColor,
       
    62                           TBool aSupportSkin = EFalse)
       
    63         {
       
    64         
       
    65         iInactiveBtnImgID = aInactiveBtnImgID;
       
    66         iNormalBtnImgID = aNormalBtnImgID;
       
    67         iPressedBtnImgID = aPressedBtnImgID;
       
    68             
       
    69         iCandidateLeftImgID = aCandidateLeftImgID;
       
    70         iCandidateMiddleImgID = aCandidateMiddleImgID;
       
    71         iCandidateRightImgID = aCandidateRightImgID;
       
    72 
       
    73         iCandidatePressedLeftImgID = aCandidatePressedLeftImgID;
       
    74         iCandidatePressedMiddleImgID = aCandidatePressedMiddleImgID;
       
    75         iCandidatePressedRightImgID = aCandidatePressedRightImgID;      
       
    76         
       
    77         iCandidatesHighlightColor = aCandidatesHighlightColor;
       
    78         
       
    79         iSupportSkin = aSupportSkin;
       
    80             
       
    81         };
       
    82         
       
    83     TDropdownListDrawInfo()
       
    84         {
       
    85         iSupportSkin = EFalse;
       
    86         };
       
    87     };    
       
    88 
       
    89 
       
    90 
       
    91 /**
       
    92  *  Context for list
       
    93  *
       
    94  *  it provide all functions used by list
       
    95  *
       
    96  *  @lib FepCtrlDropdownList.lib
       
    97  *  @since S60 v3.2
       
    98  */
       
    99 class MFepCtrlDropdownListContext
       
   100     {
       
   101 public:  // Method
       
   102 
       
   103     /**
       
   104      * Draw mask for the appointed rect
       
   105      * @since S60 v3.2
       
   106      * @param aRect the rect which will be redrawn
       
   107      * @return None
       
   108      */     
       
   109     virtual void DrawMask(TRect aRect) = 0;
       
   110 
       
   111     /**
       
   112      * Active bitmap context
       
   113      * @since S60 v3.2
       
   114      * @return None
       
   115      */         
       
   116     virtual void ActivateBitmapContext() = 0;
       
   117     
       
   118     /**
       
   119      * Get the graphics context
       
   120      * @since S60 v3.2
       
   121      * @return The graphics context
       
   122      */ 
       
   123     virtual CFbsBitGc* Gc() = 0;
       
   124 
       
   125     /**
       
   126      * Get the candidate count
       
   127      *
       
   128      * @since S60 v3.2
       
   129      * @return The candidate count.
       
   130      */      
       
   131     virtual TInt CandidateCount() const = 0;
       
   132 
       
   133     /**
       
   134      * Get the first candidate visible
       
   135      *
       
   136      * @since S60 v3.2
       
   137      * @return The first candidate index.
       
   138      */
       
   139     virtual TInt GetFirstCandidateIndex() = 0;
       
   140 
       
   141     /**
       
   142      * Get the first candidate visible
       
   143      *
       
   144      * @since S60 v3.2
       
   145      * @return The last candidate index.
       
   146      */
       
   147     virtual TInt GetLastCandidateIndex() = 0;
       
   148 
       
   149     /**
       
   150      * Set the first candidate visible
       
   151      *
       
   152      * @since S60 v3.2
       
   153      * @param aFirstIndex the first candidate index
       
   154      * @return None.
       
   155      */
       
   156     virtual void SetFirstCandidateIndex(TInt aFirstIndex) = 0;
       
   157 
       
   158     /**
       
   159      * Set the first candidate visible
       
   160      *
       
   161      * @since S60 v3.2
       
   162      * @param aLastIndex the last candidate index
       
   163      * @return None.
       
   164      */
       
   165     virtual void SetLastCandidateIndex(TInt aLastIndex) = 0;
       
   166 
       
   167     /**
       
   168      * Get the appointed candidate
       
   169      * @since S60 v3.2
       
   170      * @param aIndex The index which will be check out
       
   171      * @return The appointed candidate
       
   172      */ 
       
   173     virtual CCandidate* GetCandidate(TInt aIndex) = 0;
       
   174     
       
   175     /**
       
   176      * Get top left point
       
   177      * @since S60 v3.2
       
   178      * @return The top left point
       
   179      */ 
       
   180     virtual TPoint GetTopLeftPoint() = 0;
       
   181     
       
   182     /**
       
   183      * Get cell width
       
   184      * @since S60 v3.2
       
   185      * @return Cell width
       
   186      */ 
       
   187     virtual TInt GetCellWidth() = 0;
       
   188     
       
   189     /**
       
   190      * Get cell height
       
   191      * @since S60 v3.2
       
   192      * @return Cell height
       
   193      */ 
       
   194     virtual TInt GetCellHeight() = 0;
       
   195     
       
   196     /**
       
   197      * Get navigation width
       
   198      * @since S60 v3.2
       
   199      * @return Navigation width
       
   200      */ 
       
   201     virtual TInt GetNaviWidth() = 0;
       
   202     virtual TInt GetSpinBtnHeight() = 0;
       
   203     virtual TInt GetCellHorizontalMargin() = 0;
       
   204     virtual TInt GetCellVerticalMargin() = 0;
       
   205     virtual TInt ListType() = 0;
       
   206     virtual TInt OneRowStartCandIdx() = 0;
       
   207     virtual void SetOneRowStartCandIdx(TInt aOriginalCandIdx) = 0;
       
   208     virtual TInt GetOriginalFirstCandIdx() = 0;
       
   209     virtual void SetOriginalFirstCandIdx(TInt aOriginalFirstCandIdx) = 0;
       
   210     virtual TInt CandTruncateType() = 0;
       
   211     virtual CList* ActiveList() = 0;
       
   212     virtual void SetUpdateListReDrawFlag(TBool aReDraw) = 0;
       
   213     virtual TBool GetUpdateListRedrawFlag() = 0;
       
   214     // if set: when list expanded, and user press on region between
       
   215     // list's rect and outerrect (list's rect plus fuzzy boundry)
       
   216     // it still think that press inside list
       
   217     virtual TInt FuzzyBoundry() = 0;
       
   218     virtual TInt CandExpandType() = 0;
       
   219     virtual TInt CandHDirection() = 0;
       
   220     virtual TBool PageCtrlShown() = 0;
       
   221 
       
   222     /**
       
   223      * Get columns number
       
   224      * @since S60 v3.2
       
   225      * @return The top left point
       
   226      */ 
       
   227     virtual TInt GetColNum() = 0;
       
   228 
       
   229     /**
       
   230      * Get rows number
       
   231      * @since S60 v3.2
       
   232      * @return The top left point
       
   233      */ 
       
   234     virtual TInt GetRowNum() = 0;
       
   235 
       
   236     /**
       
   237      * Get the font used to draw text
       
   238      * @since S60 v3.2
       
   239      * @return The font used to draw text
       
   240      */ 
       
   241     virtual const CFont* GetFont() = 0;
       
   242     
       
   243     /**
       
   244      * Get alignment used to draw the text
       
   245      * @since S60 v3.2
       
   246      * @return The alignment used to draw the text
       
   247      */ 
       
   248     virtual CGraphicsContext::TTextAlign GetAlignment() = 0;
       
   249     
       
   250     /**
       
   251      * Get text margin used to draw the text
       
   252      * @since S60 v3.2
       
   253      * @return The margin used to draw the text
       
   254      */ 
       
   255     virtual TInt GetTextMargin() = 0;
       
   256 
       
   257     /**
       
   258      * Get background color
       
   259      * @since S60 v3.2
       
   260      * @return The background color
       
   261      */ 
       
   262     virtual TRgb GetBgColor() = 0;
       
   263     
       
   264     /**
       
   265      * Get button down color
       
   266      * @since S60 v3.2
       
   267      * @return The background color
       
   268      */ 
       
   269     virtual TRgb GetButtonDownBgColor() = 0;    
       
   270     
       
   271     /**
       
   272      * Get border color
       
   273      * @since S60 v3.2
       
   274      * @return The border color
       
   275      */ 
       
   276     virtual TRgb GetBorderColor() = 0;
       
   277 
       
   278     /**
       
   279      * Get text color
       
   280      * @since S60 v3.2
       
   281      * @return The text color
       
   282      */ 
       
   283     virtual TRgb GetTextColor() = 0;    
       
   284     
       
   285     /**
       
   286      * Get background color for highlight area
       
   287      * @since S60 v3.2
       
   288      * @return The background color for highlight area
       
   289      */ 
       
   290     virtual TRgb GetHighLightBgColor() = 0;
       
   291     
       
   292     /**
       
   293      * Get high light text color
       
   294      * @since S60 v3.2
       
   295      * @return The high light text color
       
   296      */ 
       
   297     virtual TRgb GetHighLightTextColor() = 0;
       
   298     
       
   299     /**
       
   300      * Get special text color
       
   301      * @since S60 v3.2
       
   302      * @return The special text color
       
   303      */ 
       
   304     virtual TRgb GetSpecialTextColor() = 0;
       
   305     
       
   306     /**
       
   307      * Get fixed text
       
   308      * @since S60 v3.2
       
   309      * @return The fixed text
       
   310      */ 
       
   311     virtual TDesC GetFixedText() = 0;
       
   312     
       
   313     /**
       
   314      * Invalidate some rect and redraw it
       
   315      * @since S60 v3.2
       
   316      * @param aRect The rect which will be redrawn
       
   317      * @param aUpdateAll Update all or not
       
   318      * @return None
       
   319      */
       
   320     virtual void Invalidate(const TRect& aRect, TBool aUpdateAll = EFalse) = 0;   
       
   321 
       
   322     /**
       
   323      * Get secondary list
       
   324      * @since S60 v3.2
       
   325      * @return The secondary list
       
   326      */     
       
   327     virtual const RArray<TInt>& GetSecondaryList() const = 0;
       
   328 
       
   329     /**
       
   330      * Get the flag of enable or disable multi color
       
   331      *
       
   332      * @since S60 v3.2
       
   333      * @return ETrue if enable, or EFalse.
       
   334      */     
       
   335     virtual TBool IsEnableSecondary() const= 0;
       
   336 
       
   337     /**
       
   338      * Get highlight cell list
       
   339      * @since S60 v3.2
       
   340      * @return The highlight cell list
       
   341      */    
       
   342     virtual const RArray<TInt>& GetHighlightList() const= 0;
       
   343 
       
   344     /**
       
   345      * Report event when candidate is selected
       
   346      * @since S60 v3.2
       
   347      * @param aCandidate The candidate string
       
   348      * @param aSelectedIndex The index of the selected candidate
       
   349      * @return None.
       
   350      */
       
   351     virtual void ReportCandidateSelectEventL(const TDesC& aCandidate, const TInt aSelectedIndex)= 0;
       
   352     
       
   353 
       
   354     /**
       
   355      * Get page manager
       
   356      * @since S60 v3.2
       
   357      * @return page manager
       
   358      */
       
   359     virtual CPages* GetPages() = 0;
       
   360 
       
   361     /**
       
   362      * Get bitmap manager
       
   363      * @since S60 v3.2
       
   364      * @return The bitmap manager
       
   365      */    
       
   366     virtual CBitmapDb* GetBitmapDb() = 0;
       
   367 
       
   368     /**
       
   369      * Change active list
       
   370      *
       
   371      * @since S60 v3.2
       
   372      * @param aList The new active list
       
   373      * @param aLastIndex The last visible candidate index  
       
   374      * @return None.
       
   375      */
       
   376     virtual void ChangeActiveList(CList* aList, TInt aLastIndex = 0) = 0; 
       
   377  
       
   378      /**
       
   379      * Get pen size
       
   380      *
       
   381      * @since S60 v3.2
       
   382      * @return The pen size.
       
   383      */
       
   384     virtual const TSize GetPenSize() = 0;
       
   385     
       
   386     /**
       
   387      * Set pointer capture
       
   388      *
       
   389      * @since S60 v3.2
       
   390      * @param aFlag ETrue to capture pointer, otherwise EFalse
       
   391      * @return None.
       
   392      */
       
   393     virtual void SetCapture(TBool aFlag ) = 0;
       
   394     
       
   395     /**
       
   396      * Get next candidate page
       
   397      *
       
   398      * @since S60 v3.2
       
   399      * @return None.
       
   400      */
       
   401     virtual void NotifyGetNextPage() = 0;
       
   402     
       
   403     /**
       
   404      * Get previous candidate page
       
   405      *
       
   406      * @since S60 v3.2
       
   407      * @return None.
       
   408      */
       
   409     virtual void NotifyGetPreviousPage() = 0;
       
   410     
       
   411     /**
       
   412      * Notify close candidate page
       
   413      *
       
   414      * @since S60 v3.2
       
   415      * @return None.
       
   416      */
       
   417     virtual void NotifyClosePage() = 0;
       
   418     
       
   419     /**
       
   420      * Judge if next candidate existed
       
   421      *
       
   422      * @since S60 v3.2
       
   423      * @return ETrue if candidate exist, otherwise EFalse
       
   424      */
       
   425     virtual TBool NextCandidateExist() = 0;
       
   426 
       
   427     /**
       
   428      * Auto change active list
       
   429      *
       
   430      * @since S60 v3.2
       
   431      * @param aLastIndex The last visible candidate index  
       
   432      * @return None.
       
   433      */
       
   434     virtual void AutoChangeActiveList( TInt aLastIndex = 0 ) = 0; 
       
   435     
       
   436     /**
       
   437      * Show preview bubble
       
   438      *
       
   439      * @since S60 v3.2
       
   440      * @param aRect Bubble rect
       
   441      * @param aText Review bubble text  
       
   442      * @return None.
       
   443      */
       
   444     virtual void DrawBubble(const TRect aRect, const TDesC& aText) = 0;
       
   445     
       
   446     /**
       
   447      * Hide preview bubble
       
   448      *
       
   449      * @since S60 v3.2
       
   450      * @return None.
       
   451      */    
       
   452     virtual void ClearBubble() = 0;
       
   453 
       
   454     /**
       
   455      * Redraw preview bubble
       
   456      *
       
   457      * @since S60 v3.2
       
   458      * @return None.
       
   459      */    
       
   460     virtual void ReDrawBubble() = 0;
       
   461     };
       
   462 
       
   463 #endif // M_DROP_DOWN_LIST_CONTEXT_H
       
   464 
       
   465 // End Of File