aknutils.h

Go to the documentation of this file.
00001 /*
00002 * ============================================================================
00003 *  Name     : AknUtils.h
00004 *  Part of  : Avkon
00005 *
00006 *  Description:
00007 *     General Avkon Utilities. Includes:
00008 *       - listbox utilities
00009 *       - layout utilities
00010 * 
00011 *  Version:
00012 *
00013 *  Copyright © 2002-2007 Nokia Corporation.
00014 *  This material, including documentation and any related 
00015 *  computer programs, is protected by copyright controlled by 
00016 *  Nokia Corporation. All rights are reserved. Copying, 
00017 *  including reproducing, storing,  adapting or translating, any 
00018 *  or all of this material requires the prior written consent of 
00019 *  Nokia Corporation. This material also contains confidential 
00020 *  information which may not be disclosed to others without the 
00021 *  prior written consent of Nokia Corporation.
00022 * ============================================================================
00023 */
00024 
00025 #ifndef __AKNUTILS_H__
00026 #define __AKNUTILS_H__
00027 
00028 #include <eiktxlbm.h>
00029 #include <avkon.hrh>
00030 #include <avkon.rsg>
00031 #include <coedef.h>
00032 #include <coecobs.h>
00033 #include <w32std.h>
00034 #include <gulalign.h>
00035 #include <gulutil.h>
00036 #include <eikenv.h>
00037 #include <biditext.h>
00038 #include <eiksbfrm.h>
00039 #include <AknsConstants.h>
00040 #include <aknenv.h>
00041 
00042 #include <aknlayout.lag>
00043 
00044 // These are for listbox column lengths (These are used to allocate memory from stack while drawing listboxes, they should be as small as possible, but not smaller!)
00045 const TInt KMaxColumnDataLength = 80; // This is maximum length of data for one listbox column -- after that the data is truncated before drawing.
00046 const TInt KMaxTotalDataLength = 8*KMaxColumnDataLength;  // max of 5 columns can have full 80 characters...
00047 
00063 class CCoeControl;
00064 class CEikTextListBox;
00065 class CEikColumnListBox;
00066 class CEikFormattedCellListBox;
00067 class CGulIcon;
00068 class CEikSettingsListBox;
00069 class CAknLAF;
00070 class CEikImage;
00071 class CEikMfne;
00072 class CEikListBox;
00073 class CEikLabel;
00074 class CEikEdwin;
00075 class CEikMenuPane;
00076 class CAknPopupField;
00077 class CListBoxView;
00078 class CAknColumnListBox;
00079 class CEikSecretEditor;
00080 class CFindExtension;
00081 class CAknLayoutFont;
00082 class TAknFontSpecification;
00083 class CAknAppUiBase;
00084 
00089 const TInt  KDefaultClipWidth = -1;
00090 const TUint KDefaultClipChar  = TUint(0x2026);
00091 
00092 // Constant to use in AknLayoutUtils to indicate that the parameter is not to be used as a override value
00093 const TInt KAknLayoutUtilsDoNotOverride = -1;
00094 
00102 class AknTextUtils 
00103     {
00104 public:
00105     enum TClipDirection
00106     {
00107     EDoNotClip,
00108     EClipFromEnd,
00109     EClipFromBeginning
00110     };
00123     IMPORT_C static TBool ClipToFit(TDes& aBuffer,
00124                                     const CFont& aFont, 
00125                                     TInt aMaxWidthInPixels,
00126                                     TClipDirection aDir=EClipFromEnd,
00127                                     TInt aClipWidth = KDefaultClipWidth,
00128                                     const TDesC &aClipString=_L("..."));
00129 
00136     IMPORT_C static TBool ClipToFit(TDes& aBuffer, 
00137                                     TClipDirection aDir,
00138                                     CEikFormattedCellListBox *aListBox,
00139                                     TInt aItemIndex,
00140                                     TInt aSubCellNumber);
00141 
00148     IMPORT_C static TBool ClipToFit(TDes& aBuffer,
00149                                     TClipDirection aDir,
00150                                     CEikColumnListBox *aListBox,
00151                                     TInt aItemIndex,
00152                                     TInt aColumnNumber);
00153 
00154     // implementation
00155 
00156     static TBool DoClipToFit(
00157         TDes& aBuffer,
00158         const CFont& aFont,
00159         TInt aMaxWidthInPixels,
00160         TClipDirection aDir,
00161         TInt aClipWidth,
00162         const TDesC& aClipString );
00163 
00174     IMPORT_C static void WrapToArrayL( 
00175         const TDesC& aStringToWrap,
00176         const CArrayFix<TInt>& aLineWidthArray,
00177         const CFont& aFont,
00178         CArrayFix<TPtrC>& aWrappedArray);
00179 
00190     IMPORT_C static void WrapToArrayL( 
00191         const TDesC& aStringToWrap,
00192         TInt aLineWidth,
00193         const CFont& aFont,
00194         CArrayFix<TPtrC>& aWrappedArray );
00195 
00212     IMPORT_C static void WrapToArrayAndClipL( 
00213         TDes& aStringToWrap,             
00214         const CArrayFix<TInt>& aLineWidthArray, 
00215         const CFont& aFont,                     
00216         CArrayFix<TPtrC>& aWrappedArray );       
00217     
00235     IMPORT_C static void ChopToArrayAndClipL(
00236         TDes& aStringToChop,             
00237         const CArrayFix<TInt>& aLineWidthArray, 
00238         const CFont& aFont,                    
00239         CArrayFix<TPtrC>& aChoppedArray);
00240 
00258     IMPORT_C static void ChopToArrayAndClipL(
00259         TDes& aStringToChop,             
00260         TInt aLineWidth, 
00261         const CFont& aFont,                    
00262         CArrayFix<TPtrC>& aChoppedArray );
00263 
00276     IMPORT_C static void WrapToStringL( 
00277         const TDesC& aStringToWrap,
00278         const CArrayFix<TInt>& aLineWidthArray,
00279         const CFont& aFont,
00280         TDes& aWrappedString );
00281 
00296     IMPORT_C static void WrapToStringAndClipL(
00297         const TDesC& aStringToWrap, 
00298         const CArrayFix<TInt>& aLineWidthArray, 
00299         const CFont& aFont, 
00300         TDes& aWrappedString ); 
00301 
00317     IMPORT_C static void StripCharacters(TDes &aDes, const TDesC &aCharacters);
00318 
00330     IMPORT_C static void ReplaceCharacters(TDes &aDes, const TDesC &aChars, TChar aReplacement);
00331 
00339     IMPORT_C static void PackWhiteSpaces(TDes &aDes, const TDesC &aWhiteSpaceChars);
00340     
00341     // non-exported implementation
00342 
00343     static void WrapToStringL(
00344         const TDesC& aStringToWrap, 
00345         const CArrayFix<TInt>& aLineWidthArray, 
00346         const CFont& aFont, 
00347         TDes& aWrappedString,
00348         TInt aFlags,
00349         TInt aDirectionality );
00350 
00351     static void WrapToArrayL( 
00352         TDes& aStringToWrap,
00353         const CArrayFix<TInt>* aLineWidthArray, 
00354         const CFont& aFont,
00355         CArrayFix<TPtrC>& aWrappedArray,
00356         TInt aLineWidth,
00357         TInt aFlags,
00358         TInt aDirectionality );
00359 
00360     static void ChopToArrayAndClipL(
00361         TDes& aStringToChop,             
00362         const CArrayFix<TInt>* aLineWidthArray,
00363         const CFont& aFont,                 
00364         CArrayFix<TPtrC>& aChoppedArray,
00365         TInt aLineWidth );    
00366 
00374     static TBool IsEmptyText( const TDesC& aTextToTest );
00375 
00390     IMPORT_C static void LanguageSpecificNumberConversion(TDes &aDes);
00391 
00400     IMPORT_C static void ConvertDigitsTo( TDes& aDes, TDigitType aDigitType );
00401 
00414     IMPORT_C static TBidiText::TDirectionality CurrentScriptDirectionality();
00415 
00422     static TDigitType InputLanguageFilteredDigitType();
00423 
00430     static TDigitType DisplayTextLanguageFilteredDigitType();
00431 
00438     IMPORT_C static TDigitType NumericEditorDigitType();
00439 
00456     IMPORT_C static void DisplayTextLanguageSpecificNumberConversion(TDes &aDes);
00457   
00469     IMPORT_C static TDigitType TextEditorDigitType();
00470 
00471     enum TDigitModeQueryType {
00472         EDigitModeEditorDefault, // in editors by default whether western or foreign digits are used (gen.editors, both text and numbers)
00473         EDigitModeUserModifiableEditor, // in editors whether user can modify digitmode with keypad
00474         EDigitModeShownToUser, // in all components when displaying digits
00475         EDigitModeNumberEditor, // number, time, date, notification texts (1st group of editors)
00476         EDigitModeLatinNumberEditor // e-mail, password, PIN codes, etc. (3rd group, where only latin can be used)
00477     };
00492     IMPORT_C static TBool DigitModeQuery(TDigitModeQueryType aQueryType = EDigitModeShownToUser);
00493 
00505     IMPORT_C static HBufC* ConvertFileNameL(const TDesC& aDes);
00506 
00507 
00512     IMPORT_C static HBufC* LoadScalableTextL(CCoeEnv& aCoe, TInt aResourceId);
00513 
00518     IMPORT_C static HBufC* LoadScalableTextLC(CCoeEnv& aCoe, TInt aResourceId);
00519 
00524     IMPORT_C static TInt LoadScalableText(CCoeEnv& aCoe, TInt aResourceId, TDes& aBuffer ); 
00525 
00530     IMPORT_C static HBufC* ClipAccordingScreenOrientationLC(CCoeEnv& aCoe, HBufC* aBuf); 
00531 
00552     IMPORT_C static TPtrC ChooseScalableText(
00553         const TDesC& aText,
00554         const CFont& aFont,
00555         TInt aMaxWidthInPixels );
00556     };
00557 
00558 _LIT(KAknStripTabs, "\t");
00559 _LIT(KAknStripListControlChars, "\t\n");
00560 _LIT(KAknReplaceTabs, "\t");
00561 _LIT(KAknReplaceListControlChars, "\t\n");
00562 _LIT(KAknCommonWhiteSpaceCharacters, " \n\t\r");
00563 
00574 class AknSelectionService
00575     {
00576 public:
00579     IMPORT_C static void HandleSelectionListProcessCommandL(
00580         TInt aCommand,
00581         CEikListBox* aListBox);
00582 
00585     IMPORT_C static void HandleMultiselectionListProcessCommandL(
00586         TInt aCommand,
00587         CEikListBox* aListBox);
00588 
00591     IMPORT_C static void HandleMarkableListProcessCommandL(
00592         TInt aCommand,
00593         CEikListBox* aListBox);
00594 
00597     IMPORT_C static TKeyResponse HandleMenuListOfferKeyEventL(
00598         const TKeyEvent& aKeyEvent,
00599         TEventCode aType,
00600         CEikListBox* aListBox);
00601 
00604     IMPORT_C static void HandleMarkableListDynInitMenuPane(
00605         TInt aResourceId,
00606         CEikMenuPane *aMenu,
00607         CEikListBox *aListBox);
00608 
00611     IMPORT_C static void HandleMarkableListDynInitMenuItem(
00612         CEikMenuPane *aMenu,
00613         CEikListBox *aListBox,
00614         TInt aCommandId,
00615         TBool aCanBeAppliedToMultipleItems);
00616 
00619     IMPORT_C static void HandleMarkableListUpdateAfterCommandExecution(
00620         CEikListBox *aListBox);
00621 
00624     IMPORT_C static void HandleItemRemovalAndPositionHighlightL(
00625         CEikListBox *aListBox,
00626         TInt aValueOfCurrentItemIndexBeforeRemoval,
00627         TBool aCurrentItemWasRemoved);
00628 
00629     // This one updates selectionindexes too.
00635     IMPORT_C static void HandleItemRemovalAndPositionHighlightL(
00636         CEikListBox *aListBox,
00637         TInt aValueOfCurrentItemIndexBeforeRemoval,
00638         CArrayFix<TInt> &aIndexesOfRemovedItemsBeforeRemoval);
00639     };
00640 
00641 
00642 
00643 class CAknSearchField;
00644 
00657 class AknFind
00658     {
00659 public:
00660 
00661     /*
00662      * Implements the event handlers for the find pane. This method must be
00663      * called when a @c ProcessCommandL event is received and a find pane is on
00664      * the screen.
00665      *
00666      * @param aCommand Command id.
00667      * @param aListBox Pointer to listbox control.
00668      * @param aSearchField Pointer to search field control.
00669      * @param aParentControl Parent control.
00670      */
00671     IMPORT_C static void HandleFindPopupProcessCommandL(
00672                         TInt aCommand, 
00673                         CEikListBox* aListBox, 
00674                         CAknSearchField* aSearchField, 
00675                         CCoeControl* aParentControl);
00676     
00677     /*
00678      * Handles key events for the find pane. This method must be called when
00679      * control receives @c OfferKeyEventL event.
00680      *
00681      * @param aKeyEvent The key event.
00682      * @param aType The type of key event:@c TEventCode.
00683      * @param aListBoxParent Pointer to the parent control.
00684      * @param aListBox Pointer to listbox control.
00685      * @param aSearchField Pointer to search field control.
00686      * @param isFindPopup @c ETrue if popup find pane, @c EFalse if normal find
00687      *        pane.
00688      * @param aNeedRefresh @c ETrue when find pane is redrawn.
00689      */    
00690     IMPORT_C static TKeyResponse HandleFindOfferKeyEventL(
00691                         const TKeyEvent& aKeyEvent, 
00692                         TEventCode aType, 
00693                         CCoeControl* aListBoxParent, 
00694                         CEikListBox* aListBox, 
00695                         CAknSearchField* aSearchField, 
00696                         TBool isFindPopup, 
00697                         TBool &aNeedRefresh);
00698 
00699     /*
00700      * Do not use this method.
00701      *
00702      * @deprecated Use @c AknFind::HandleFixedFindSizeChanged() and 
00703      *             @c AknFind::HandlePopupFindSizeChanged instead.
00704      *        
00705      */
00706     IMPORT_C static void HandleFindSizeChanged(
00707             CCoeControl* aParentControl, 
00708             CEikListBox* aListBox, 
00709             CAknSearchField* aSearchField, 
00710             TBool ispopup = ETrue, 
00711             TInt aFindWindowResourceId = R_AVKON_POPUP_FIND_WINDOW, 
00712             TInt aListAreaId = R_AVKON_LIST_GEN_PANE, 
00713             TInt aListResourceIdWithFindPopup = 
00714                                 R_AVKON_LIST_GEN_PANE_WITH_FIND_POPUP, 
00715             TInt aFindWindowParentResourceId = 
00716                                 R_AVKON_MAIN_PANE_WITH_STATUS_PANE);
00717 
00728     IMPORT_C static void HandleFixedFindSizeChanged(
00729             CCoeControl* aParentControl,
00730             CAknColumnListBox* aListBox, // only available with column lists
00731             CAknSearchField* aSearchField);
00732     
00742     IMPORT_C static void HandlePopupFindSizeChanged(
00743                             CCoeControl* aParentControl,
00744                             CEikListBox* aListBox,  //available with all lists.
00745                             CAknSearchField* aSearchField);
00746     
00762     IMPORT_C static void HandleFindSizeChangedLayouts(
00763                             CCoeControl* aParentControl, 
00764                             CEikListBox* aListBox, 
00765                             CAknSearchField* aSearchField, 
00766                             const TAknWindowLineLayout& aFindWindow,
00767                             const TAknWindowLineLayout& aListArea,
00768                             TBool aIsPopup,
00769                             const TAknWindowLineLayout& aFindWindowParent );
00770 
00771 public:
00772 
00783     IMPORT_C static TBool IsFindMatch(const TDesC& aItemText, 
00784                                       const TDesC& aSearchText);
00785 
00795     IMPORT_C static TBool IsFindWordSeparator(TChar aCh);
00796 
00797 
00807     static void HandleFindPaneVisibility(CAknSearchField* aSearchField, 
00808                                          TBool ispopup, 
00809                                          TBool textchanged, 
00810                                          TBool &aNeedRefresh);
00811     };
00812 
00813 
00818 class AknEditUtils
00819     {
00820     public:
00821     
00823     struct SAknEditorParameters 
00824     {
00826         TInt iEditingSpace;
00827         
00829         TInt iEditingWindow;
00830         
00835         TInt iCharacterCase;
00836         
00841         TInt iJustification;
00842         
00844         TBool iAllowedToMoveInsertionPoint;
00845         
00847         TBool iCursorYesNo;
00848         
00850         TBool iOverflowYesNo;
00851     };
00852 
00853     IMPORT_C static void ConstructEditingL(CEikEdwin* aEdwin, TInt aResourceId);
00854     IMPORT_C static void ConstructEditingL(CEikEdwin* aEdwin, TResourceReader& aReader);
00855     IMPORT_C static void ConstructEditingL(CEikEdwin* aEdwin, const SAknEditorParameters &aParams);
00856 
00875     IMPORT_C static void ConstructEditingL(CEikEdwin* aEdwin, 
00876                        TInt aEditingSpace, 
00877                        TInt aEditingWindow, 
00878                        TInt aCharacterCase, 
00879                        TInt aJustification, 
00880                        TBool aAllowedToMoveInsertionPoint, 
00881                        TBool aCursorYesNo, 
00882                        TBool aOverflowYesNo);
00883                        
00903     IMPORT_C static void ConstructEditingL(CEikEdwin* aEdwin, 
00904                                               TInt aEditingSpace, 
00905                                               TInt aEditingWindow, 
00906                                               TInt aCharacterCase, 
00907                                               TInt aJustification, 
00908                                               TBool aAllowedToMoveInsertionPoint, 
00909                                               TBool aCursorYesNo, 
00910                                               TBool aOverflowYesNo,
00911                                               TBool aIsResizable);
00912 
00913     };
00914 
00922 class CListBoxNumbers : public CBase
00923     {
00924 public:
00925     IMPORT_C CListBoxNumbers(CEikTextListBox* aListBox);
00926     IMPORT_C void ConstructL();
00927     IMPORT_C void UpdateL();
00928 private:
00929     CEikTextListBox* iListBox;
00930     };
00931 
00932 class CAknListBoxFilterItems;
00933 
00943 class CAknFilteredTextListBoxModel : public CTextListBoxModel, public MDesCArray
00944     {
00945 public: // public interface for apps
00952     IMPORT_C void CreateFilterL(CEikListBox* aListBox, CAknSearchField* aSearchField);
00956     IMPORT_C void RemoveFilter();
00961     IMPORT_C CAknListBoxFilterItems* Filter() const;
00965     IMPORT_C ~CAknFilteredTextListBoxModel();
00966 public: // from CTextListBoxMode
00971     IMPORT_C virtual TInt NumberOfItems() const;
00977     IMPORT_C virtual TPtrC ItemText(TInt aItemIndex) const;
00978 public: // from MEikTextListBoxModel (default filtering string conversions)
00983     IMPORT_C const MDesCArray* MatchableTextArray() const;
00984 
00985 private:
00986     CAknListBoxFilterItems* iFilter; // owned
00987 private: // From MdesCArray (these implement default matchabletextarray for filtering.)
00988     IMPORT_C TInt MdcaCount() const;
00989     IMPORT_C TPtrC MdcaPoint(TInt aIndex) const;
00990 private: // from MListBoxModel
00991     IMPORT_C virtual TAny* MListBoxModel_Reserved();
00992     };
00993 
01011 class CAknListBoxFilterItems : public CBase, public MCoeControlObserver
01012     {
01013 public:
01022     IMPORT_C CAknListBoxFilterItems(
01023         CEikListBox *aListBox,
01024         CAknSearchField *aSearchField,
01025         MListBoxModel *aModel,
01026         CListBoxView *aView);
01027 
01031     IMPORT_C void ConstructL(); // for setting empty list text.
01035     IMPORT_C void ResetFilteringL();
01040     IMPORT_C void UpdateCachedDataL(); // updates iOldSearchCriteria and selection indexes.
01045     IMPORT_C ~CAknListBoxFilterItems();    
01046 
01047 public: 
01052     IMPORT_C CArrayFix<TInt> *SelectionIndexes();
01058     IMPORT_C void UpdateSelectionIndexesL();
01065     IMPORT_C void UpdateSelectionIndexL(TInt aVisibleIndex);
01066 
01067 public: // Applications should call this in their listbox model implementation
01073     IMPORT_C TInt FilteredNumberOfItems() const;
01080     IMPORT_C TInt FilteredItemIndex(TInt aVisibleItemIndex) const;
01081 
01082 public: // Needed to change the correct item.
01083 
01088     IMPORT_C TInt NonFilteredNumberOfItems() const; // this always returns >= FilteredNumberOfItems()
01095     IMPORT_C TInt VisibleItemIndex(TInt aOriginalIndex) const;
01096 public: 
01103     IMPORT_C TPtrC DefaultMatchableItemFromItem(TPtrC aText);
01104 
01105 public: 
01110     IMPORT_C void HandleOfferkeyEventL();
01114     IMPORT_C void HandleItemArrayChangeL();
01115 
01116 public: // MCoeControlObserver
01121     IMPORT_C void SetObserver(MCoeControlObserver *aObserver);
01127     IMPORT_C void HandleControlEventL(CCoeControl *aControl, TCoeEvent aEventType);
01128 
01129 public: // For FEP
01137     IMPORT_C void DeferredSendKeyEventToFepL(TUint aValue);
01145     static TInt IdleCallBack(TAny *aFilterItems);
01146 
01147 public: // For size changed
01155     IMPORT_C void SetParentControl(CCoeControl *aControl);
01160     IMPORT_C void SetPopup();
01161 
01162 public: // For detaching and attaching list, findbox, model and view...
01168     IMPORT_C void SetListBox(CEikListBox *aListBox);
01174     IMPORT_C void SetSearchField(CAknSearchField *aSearchField);
01180     IMPORT_C void SetModel(MListBoxModel *aModel);
01186     IMPORT_C void SetView(CListBoxView *aView);
01187     
01188 public:
01193     IMPORT_C CCoeControl *FindBox() const;
01194 
01195 private:
01196     void NoCriteriaL(); // remove criteria completely.
01197     void TightenCriteriaL(const TDesC& aCriteria); // slow operation (do when adding new characters to search criteria)
01198     void ReleaseCriteriaL(const TDesC& aCriteria); // very slow operation (do when removing characters from search criteria)
01199     // EmptyListText handling
01200     void InstallEmptyTextL();
01201     void UninstallEmptyTextL();
01202     // Selections -- these methods form a pair, 
01203     // you must call Fetch first and then push.
01204     void FetchSelectionIndexesFromListBoxL();
01205     void PushSelectionIndexesToListBoxL();
01206 
01207     // HandleItemAddition without ResetFilteringL() call
01208     void HandleItemAdditionL();
01209     void HandleItemRemovalL();
01210 private:
01211     TBool IsItemVisible(const TDesC& aMatchableItemString, const TDesC& aSearchText);
01212     static TBool IsSeparatorCharacter(TChar c);
01213     TBool IsItemSelected(TInt aRealIndex) const;
01214 private:
01215     CArrayFix<TInt> *iShownIndexes; // own // uses non-filtered indexes
01216     CArrayFix<TInt> *iSelectionIndexes; // own   // this uses non-filtered indexes
01217     HBufC *iOldSearchCriteria; // own
01218     MListBoxModel *iModel;
01219     CListBoxView *iView;
01220     TInt iOldItemCount;
01221     HBufC* iEmptyListText; // own
01222     CEikListBox* iListBox;
01223     CAknSearchField* iSearchField;
01224     TBuf<256> iMatchableText;
01225     MCoeControlObserver *iObserver;
01226     CFindExtension *iExtension;
01227     TUint iKeyValue;
01228     CCoeControl *iParentControl;
01229     TBool iIsPopup;
01230     TBool iDisableChangesToShownIndexes;
01231     };
01232 
01233 
01240 template<class T>
01241 class NoOptimizationView : public T
01242     {
01243 public:
01244     virtual void VScrollTo(TInt aNewTopItemIndex, TRect& aMinRedrawRect)
01245     {
01246     // AVKON LAF
01247     if (this->RedrawDisabled())
01248         return;
01249     if (this->iTopItemIndex == aNewTopItemIndex)
01250         return;
01251     aMinRedrawRect.SetRect(this->iViewRect.iTl,this->iViewRect.Size());
01252     this->SetTopItemIndex(aNewTopItemIndex);
01253     this->Draw(&aMinRedrawRect);
01254     // end of AVKON LAF
01255     }
01256     };
01257 
01258 
01265 class AknLAFUtils 
01266     {
01267 public:
01268     static void DrawLines(CGraphicsContext* aGc, 
01269                   const TRect& mainpane,
01270                   TInt x);
01271     IMPORT_C static void ReplaceColumn(TPtr aTarget, TDesC* aSource,
01272                                        TDesC* aReplacement, TChar aColumnSeparator,
01273                                        TInt aColumn);
01274     };
01275 
01276 
01286 struct SAknLayoutGfx;
01287 struct SAknLayoutText;
01288 struct SAknLayoutCmd;
01289 struct SAknLayoutGfx;
01290 // Not for apps
01291 struct SAknLayoutPos 
01292     {
01293     TInt l, t, r, b, W, H;
01294 
01295     typedef SAknLayoutPos ItemType;
01296     static void ReadResource(TResourceReader& aReader, ItemType& aTarget);    
01297     };
01298 template<class T> class CArrayReader;
01299 class CAknGenericReader : public CBase
01300     {
01301 public:
01302     IMPORT_C void ConstructL(TInt aResourceId);
01303     IMPORT_C virtual void ConstructFromResourceL(TResourceReader& aReader);
01304     IMPORT_C ~CAknGenericReader();
01305 
01306     IMPORT_C const SAknLayoutGfx* GfxItem(TInt aIndex) const;
01307     IMPORT_C const SAknLayoutText* TextItem(TInt aIndex) const;
01308     IMPORT_C const SAknLayoutCmd* CmdItem(TInt aIndex) const;
01309     IMPORT_C const SAknLayoutGfx* AreaItem(TInt aIndex) const;
01310 
01311     CArrayReader<SAknLayoutGfx>* iGfx;
01312     CArrayReader<SAknLayoutText>* iText;
01313     CArrayReader<SAknLayoutCmd>* iCmd;
01314     CArrayReader<SAknLayoutGfx>* iArea;
01315     };
01316 
01317 
01318 
01319 
01320 
01321 // Use this to mark that the position in LAF specification is empty.
01322 const TInt AknLayoutUtilsNoValue = ELayoutEmpty;
01323 
01355 class AknLayoutUtils
01356     {
01357 public:
01358 
01359     struct SAknLayoutText
01360     {
01361     TInt iFont, iC, iL, iR, iB, iW, iJ;
01362     };
01363     struct SAknLayoutTextMultiline
01364     {
01365     TInt iFont, iC, iL, iR, iB, iW, iJ, iNumberOfLinesShown, iNextLineB;
01366     };
01367     typedef SAknLayoutTextMultiline SAknLayoutLabel;
01368     typedef SAknLayoutTextMultiline SAknLayoutEdwin;
01369     typedef SAknLayoutText SAknLayoutMfne;
01370     typedef SAknLayoutText SAknLayoutSecEd;
01371     struct SAknLayoutRect
01372     {
01373     TInt iC, iL, iT, iR, iB, iW, iH;
01374     };
01375     typedef SAknLayoutRect SAknLayoutControl;
01376     typedef SAknLayoutRect SAknLayoutImage;
01377 
01381     IMPORT_C static void LayoutLabel(CEikLabel* aLabel,
01382                                      const TRect& aLabelParent,
01383                                      TInt aResourceId,
01384                                      const CFont* aCustomFont=0);
01385 
01389     IMPORT_C static void LayoutLabel(CEikLabel* aLabel,
01390                                      const TRect& aLabelParent,
01391                                      TResourceReader& aReader,
01392                                      const CFont* aCustomFont=0);
01393 
01397     IMPORT_C static void LayoutLabel(CEikLabel* aLabel,
01398                                      const TRect& aLabelParent,
01399                                      const SAknLayoutLabel& aLayout,
01400                                      const CFont *aCustomFont=0);
01401 
01405     IMPORT_C static void LayoutLabel(CEikLabel* aLabel,
01406                                      const TRect& aLabelParent,
01407                                      const TAknMultiLineTextLayout& aLayout,
01408                                      const CFont *aCustomFont=0);
01409 
01413     IMPORT_C static void LayoutLabel(CEikLabel* aLabel,
01414                                      const TRect& aLabelParent,
01415                                      const TAknTextLineLayout& aLayout,
01416                                      const CFont *aCustomFont=0);
01417 
01430     IMPORT_C static void LayoutLabel(CEikLabel* aLabel,
01431                                      const TRect& aLabelParent,
01432                                      TInt font, TInt C,
01433                                      TInt l, TInt r,
01434                                      TInt B, TInt W,
01435                                      TInt J, TInt NextLineB=0,
01436                                      const CFont* aCustomFont=0);
01437 
01441     IMPORT_C static void LayoutEdwin(CEikEdwin* aEdwin,
01442                                      const TRect& aEdwinParent,
01443                                      TInt aResourceId,
01444                                      TInt aNumberOfLines = 0,
01445                                      const CFont* aCustomFont=0,
01446                                      TBool aMinimizeEdwinView=EFalse);
01450     IMPORT_C static void LayoutEdwin(CEikEdwin* aEdwin,
01451                                      const TRect& aEdwinParent,
01452                                      TResourceReader& aReader,
01453                                      TInt aNumberOfLines = 0,
01454                                      const CFont* aCustomFont=0,
01455                                      TBool aMinimizeEdwinView=EFalse);
01456 
01460     IMPORT_C static void LayoutEdwin(CEikEdwin* aEdwin,
01461                                      const TRect& aEdwinParent,
01462                                      const SAknLayoutEdwin& aLayout,
01463                                      const CFont* aCustomFont=0,
01464                                      TBool aMinimizeEdwinView=EFalse);
01465 
01470     IMPORT_C static void LayoutEdwin( CEikEdwin* aEdwin,
01471                                       const TRect& aEdwinParent,
01472                                       const TAknMultiLineTextLayout& aLayout,
01473                                       const CFont* aCustomFont=0,
01474                                       TBool aMinimizeEdwinView=EFalse);
01475 
01476     IMPORT_C static void LayoutEdwin( CEikEdwin* aEdwin,
01477                                       const TRect& aEdwinParent,
01478                                       const TAknMultiLineTextLayout& aLayout,
01479                                       TAknsQsnTextColorsIndex aOverrideColor,
01480                                       const CFont* aCustomFont=0,
01481                                       TBool aMinimizeEdwinView=EFalse ); 
01482         
01483 
01484 
01485     IMPORT_C static void LayoutEdwin( CEikEdwin* aEdwin,
01486                                       const TRect& aEdwinParent,
01487                                       const TAknTextLineLayout& aLayout,
01488                                       const CFont* aCustomFont=0,
01489                                       TBool aMinimizeEdwinView=EFalse );
01490 
01491     IMPORT_C static void LayoutEdwin( CEikEdwin* aEdwin,
01492                                       const TRect& aEdwinParent,
01493                                       const TAknTextLineLayout& aLayout,
01494                                       TAknsQsnTextColorsIndex aOverrideColor,
01495                                       const CFont* aCustomFont=0,
01496                                       TBool aMinimizeEdwinView=EFalse );
01497 
01525     IMPORT_C static void LayoutEdwin( CEikEdwin* aEdwin,
01526                          const TRect& aEdwinParent,
01527                          const TAknTextLineLayout& aLayout,
01528                          TInt aNumberOfLinesToShowOverRide,
01529                          TInt aBaselineSeparationOverRide,
01530                          TAknsQsnTextColorsIndex aOverrideColor, 
01531                          TInt& aNumberOfVisibleLines );
01532                                  
01546     IMPORT_C static void LayoutEdwin( CEikEdwin* aEdwin,
01547                                       const TRect& aEdwinParent,
01548                                       TInt font,
01549                                       TInt C,
01550                                       TInt l,
01551                                       TInt r,
01552                                       TInt B,
01553                                       TInt W,
01554                                       TInt J,
01555                                       TInt aNumberOfLinesShown,
01556                                       TInt aNextLineBaseline,
01557                                       const CFont* aCustomFont=0 ,
01558                                       TBool aMinimizeEdwinView=EFalse );
01559 
01560     IMPORT_C static void LayoutEdwin( CEikEdwin* aEdwin,
01561                                       const TRect& aEdwinParent,
01562                                       TInt font,
01563                                       TInt C,
01564                                       TInt l,
01565                                       TInt r,
01566                                       TInt B,
01567                                       TInt W,
01568                                       TInt J,
01569                                       TInt aNumberOfLinesShown,
01570                                       TInt aNextLineBaseline,
01571                                       TAknsQsnTextColorsIndex aOverrideColor,
01572                                       const CFont* aCustomFont=0 ,
01573                                       TBool aMinimizeEdwinView=EFalse );
01577     IMPORT_C static TRect MinimizedEdwinRect(const CEikEdwin *aEdwin);
01578 
01579 
01583     IMPORT_C static void LayoutMfne(CEikMfne* aMfne,
01584                                     const TRect& aMfneParent,
01585                                     TInt aResourceId);
01589     IMPORT_C static void LayoutMfne(CEikMfne* aMfne,
01590                                     const TRect& aMfneParent,
01591                                     TResourceReader& aReader);
01592 
01593     IMPORT_C static void LayoutMfne(CEikMfne* aMfne,
01594                                     const TRect& aMfneParent,
01595                                     const SAknLayoutMfne& aLayout);
01596 
01597     IMPORT_C static void LayoutMfne(CEikMfne* aMfne,
01598                                     const TRect& aMfneParent,
01599                                     const TAknTextLineLayout& aLayout);
01600 
01601     IMPORT_C static void LayoutMfne(CEikMfne* aMfne,
01602                                     const TRect& aMfneParent,
01603                                     TInt font, TInt C, TInt l, TInt r,
01604                                     TInt B, TInt W, TInt J);
01605 
01609     IMPORT_C static void LayoutControl(CCoeControl* aControl, 
01610                                        const TRect& aControlParent,
01611                                        TInt aResourceId);
01615     IMPORT_C static void LayoutControl(CCoeControl* aControl,
01616                                        const TRect& aControlParent,
01617                                        TResourceReader& aReader);
01618 
01619     IMPORT_C static void LayoutControl(CCoeControl* aControl,
01620                                        const TRect& aControlParent,
01621                                        const SAknLayoutControl& aLayout);
01622 
01623     IMPORT_C static void LayoutControl(CCoeControl* aControl, 
01624                                        const TRect& aControlParent,
01625                                        const TAknWindowLineLayout& aLayout);
01626 
01627     IMPORT_C static void LayoutControl(CCoeControl* aControl,
01628                                        const TRect& aControlParent,
01629                                        TInt /*C*/, TInt l, TInt t, TInt r, TInt b,
01630                                        TInt W, TInt H);
01631 
01635     IMPORT_C static void LayoutImage(CEikImage* aImage,
01636                                      const TRect& aParent,
01637                                      TInt aResourceId);
01641     IMPORT_C static void LayoutImage(CEikImage* aImage, 
01642                                      const TRect& aParent,
01643                                      TResourceReader& aReader);
01644 
01645     IMPORT_C static void LayoutImage(CEikImage* aImage, 
01646                                      const TRect& aParent,
01647                                      const SAknLayoutControl& aLayout);
01648 
01649     IMPORT_C static void LayoutImage(CEikImage* aImage,
01650                                      const TRect& aParent,
01651                                      const TAknWindowLineLayout& aLayout);
01652 
01653     IMPORT_C static void LayoutImage(CEikImage* aImage,
01654                                      const TRect& aParent,
01655                                      TInt C, TInt l, TInt t, TInt r, TInt b,
01656                                      TInt W, TInt H);
01657 
01661     IMPORT_C static void LayoutSecretEditor(CEikSecretEditor* aSecEd,
01662                                             const TRect& aParent,
01663                                             const SAknLayoutText& aLayout);
01664 
01665     IMPORT_C static void LayoutSecretEditor(CEikSecretEditor* aSecEd,
01666                                             const TRect& aParent,
01667                                             const TAknTextLineLayout& aLayout);
01668 
01669 public:
01675     IMPORT_C static TRect TextRectFromCoords(const TRect& aParent,
01676                                              const CFont* aFont,
01677                                              TInt l, TInt r,
01678                                              TInt B, TInt W,
01679                                              TInt LB = 0);
01680 
01681     IMPORT_C static TRect RectFromCoords(const TRect& aParent,
01682                                          TInt l, TInt t, TInt r, TInt b,
01683                                          TInt W, TInt H);
01684 
01703     IMPORT_C static const CFont* FontFromId(TInt aFontId, const CFont* aCustomFont=0);
01704 
01722     IMPORT_C static const CAknLayoutFont* LayoutFontFromId(TInt aId, 
01723                                                            const CAknLayoutFont *aCustomFont = 0);
01724 
01734     IMPORT_C static CAknLayoutFont* CreateLayoutFontFromSpecificationL( 
01735         const TAknFontSpecification& aSpec );
01736 
01749     IMPORT_C static CAknLayoutFont* CreateLayoutFontFromSpecificationL( 
01750         const TTypeface& aTypeface, 
01751         const TAknFontSpecification& aSpec);
01752 
01756     IMPORT_C static const CFont* FontFromName(const TDesC& aName); 
01757 
01758     IMPORT_C static CGraphicsContext::TTextAlign TextAlignFromId(TInt aId);
01759 
01760     IMPORT_C static TGulAlignment GulAlignFromId(TInt aId);
01761 
01762     IMPORT_C static TInt CursorHeightFromFont(const TFontSpec& aFont);
01763 
01764     IMPORT_C static TInt CursorWidthFromFont (const TFontSpec& aFont);
01765 
01766     IMPORT_C static TInt CursorAscentFromFont(const TFontSpec& aFont);
01767 
01768     IMPORT_C static void CursorExtensionsFromFont(const TFontSpec& /*aFont*/,
01769                                                   TInt& aFirstExtension,
01770                                                   TInt& aSecondExtension);
01771 
01772     IMPORT_C static TInt HighlightLeftPixelsFromFont (const TFontSpec& aFont);
01773 
01774     IMPORT_C static TInt HighlightRightPixelsFromFont(const TFontSpec& aFont);
01775     static void HighlightExtensionsFromFont(const TInt fontid,
01776                                             TInt& aLeft, TInt& aRight,
01777                                             TInt&  aTop, TInt& aBottom);
01778 
01791     static const CAknLayoutFont* MatchFontFromSystemFontArray( 
01792         const TFontSpec& aSpec, MGraphicsDeviceMap* aMap );
01793 
01794     IMPORT_C static TBool LayoutMirrored();
01795 
01796     /*
01797     * This method returns build variant based on which flag is active,
01798     * __AVKON_ELAF__ or __AVKON_APAC__.
01799     *
01800     * If you need to decide which layout to use, do not do it based on this method.
01801     * Instead, use CAknEnv::GetCurrentLayoutId().
01802     *
01803     * @return current variant
01804     */
01805     IMPORT_C static EVariantFlag Variant();
01806 
01807     IMPORT_C static ESubVariantFlag SubVariant();
01808 
01809     IMPORT_C static void OverrideControlColorL(
01810         CCoeControl& aControl,
01811         TLogicalColor aLogicalColor,
01812         TRgb aColor);
01813     
01814     /*
01815     * This method returns the default scrollbar type for the given application. 
01816     * For non-layout aware applications (e.g. legacy apps designed for 176x208 screen) 
01817     * this method returns always EArrowHead. But for layout aware apps the returned type 
01818     * may vary depending on the type of scrollbar which has been set as preferred 
01819     * scrollbar type in the device.
01820     *
01821     * Note that applications may use freely whatever scrollbartype, this method only 
01822     * returns the default scrollbartype for the application.
01823     * 
01824     * 
01825     * @param  aApplication Application of which default scrollbar type is requested.
01826     * @return Default scrollbar type for the given application
01827     */
01828     IMPORT_C static CEikScrollBarFrame::TScrollBarType DefaultScrollBarType(CAknAppUiBase* aApplication);
01829 
01830     /*
01831     * This method sets the layout for vertical scrollbar of the given scrollbar frame. Layout
01832     * can freely only be set for EDoubleSpan type scrollbars.
01833     * 
01834     * 
01835     * @param  aScrollBarFrame   Scrollbarframe of which vertical scrollbar layout will be set.
01836     * @param  aControlParent    Rect of the parent control of the scrollbarframe.
01837     * @param  aLayout           Layout for the vertical scrollbar.
01838     *
01839     *
01840     * This method can also be useful when layout of the scrollbar needs to be changed for scrollbars
01841     * which are owned by some other components such as e.g. ListBoxes, Editors or Grids.
01842     *
01843     * Example of use:
01844     *
01845     *  // Get a pointer to scrollbarframe of the listbox
01846     *  CEikScrollBarFrame* frame = iListBox->ScrollBar();
01847     *  
01848     *  // Get the layout data
01849     *  TAknWindowLineLayout layout = GetMyListBoxLayout();
01850     *  Trect parentRect = GetMyListBoxParentRect();
01851     *
01852     *  // Set the layout
01853     *  AknLayoutUtils::LayoutVerticalScrollBar(frame, parentRect, layout);
01854     *
01855     *  // The layout for scrollbar is now set.
01856     *
01857     */
01858     IMPORT_C static void LayoutVerticalScrollBar(
01859         CEikScrollBarFrame* aScrollBarFrame,
01860         const TRect& aControlParent,
01861         const TAknWindowLineLayout& aLayout);
01862 
01863     /*
01864     * This method sets the layout for horizontal scrollbar of the given scrollbar frame. Layout
01865     * can freely only be set for EDoubleSpan type scrollbars.
01866     * 
01867     * 
01868     * @param  aScrollBarFrame   Scrollbarframe of which horizontal scrollbar layout will be set.
01869     * @param  aControlParent    Rect of the parent control of the scrollbarframe.
01870     * @param  aLayout           Layout for the horizontal scrollbar.
01871     *
01872     *
01873     * Usage of this method is similar as for LayoutVerticalScrollBar().
01874     *
01875     */
01876     IMPORT_C static void LayoutHorizontalScrollBar(
01877         CEikScrollBarFrame* aScrollBarFrame,
01878         const TRect& aControlParent,
01879         const TAknWindowLineLayout& aLayout);
01880 
01881 public:   // Metrics API
01882 
01886     enum TAknLayoutMetrics
01887     {
01889         EScreen,
01890         
01892         EApplicationWindow,
01893         
01895         EStatusPane,
01896         
01898         EMainPane,
01899         
01901         EControlPane,   
01902         
01904         ESignalPane,
01905         
01907         EContextPane,
01908         
01910         ETitlePane,
01911         
01913         EBatteryPane,
01914         
01919         EUniversalIndicatorPane,
01920         
01926         ENaviPane,
01927         
01931         EFindPane,
01932         
01934         EWallpaperPane,
01935         
01940         EIndicatorPane,
01941         
01943         EAColunm,
01944         
01946         EBColunm,
01947         
01952         ECColunm,
01953         
01958         EDColunm,
01959         
01961         EStatusPaneSecondary,
01962         
01964         EControlPaneSecondary,
01965         
01967         EStaconTop,
01968         
01970         EStaconBottom,
01971         
01973         EStatusPaneBottom = EStatusPaneSecondary,
01974         
01976         EControlPaneBottom = EControlPaneSecondary,
01977         
01979         EControlPaneTop = EControlPane,
01980         
01982         EStatusPaneTop = EStatusPane
01983     };
01984 
01985 
01999     IMPORT_C static TBool LayoutMetricsRect(TAknLayoutMetrics aParam, TRect& aRect);
02000 
02014     IMPORT_C static TBool LayoutMetricsSize(TAknLayoutMetrics aParam, TSize& aSize);
02015 
02029     IMPORT_C static TBool LayoutMetricsPosition(TAknLayoutMetrics aParan, TPoint& aPos);
02030 public:
02045     static TInt CorrectBaseline(TInt aParentHeight, TInt aBaseline, TInt aFontId);
02046 
02050     static void CorrectFontId(TRect aParent, TInt at, TInt aH, TInt ab, TInt &aFontId);
02051 
02058     IMPORT_C static TBool ScalableLayoutInterfaceAvailable();
02059     
02060     /*
02061     * Enumeration of CBA's possible locations.
02062     * 
02063     */
02064     enum TAknCbaLocation
02065         {
02066         EAknCbaLocationBottom, //landscape and portrait
02067         EAknCbaLocationRight,  //only landscape
02068         EAknCbaLocationLeft    //only landscape
02069         };
02070     
02079     IMPORT_C static TAknCbaLocation CbaLocation();
02080 
02087     static TRect HighlightBasedRect( const TRect& aHighlightRect, CCoeControl* aControl );
02088 
02092     enum TAknMainPaneState 
02093         {
02094         EAknMainPaneForTinyStatusPane = 0x0001  // for 3x4 grid or app shell list views
02095         };
02096     IMPORT_C static TAknMainPaneState MainPaneState();
02097 
02102     IMPORT_C static TBool PenEnabled();
02103     
02108     IMPORT_C static TBool MSKEnabled();
02109 
02135     IMPORT_C static void GetEdwinVerticalPositionAndHeightFromLines(
02136         TInt aParentHeight,
02137         const TAknTextLineLayout& aLayout,
02138         TInt aBaselineSeparationOverRide,
02139         TInt aNumberOfLinesToShowOverRide,
02140         TInt& aEdwinVerticalPositionRelativeToParent,
02141         TInt& aEdwinHeight
02142         );
02143        
02164     IMPORT_C static TInt EdwinLinesWithinHeight (
02165         const TAknTextLineLayout& aLayout,
02166         TInt aBaselineSeparationOverride,
02167         TInt aMaxHeight,
02168         TInt& aUsedHeight
02169         );
02170 };
02171 
02176 class TAknLayoutText
02177     {
02178 public:
02179     IMPORT_C TAknLayoutText();
02184     IMPORT_C void LayoutText(const TRect& aParent, TInt aResourceId,
02185                              const CFont* aCustomFont=0);
02186 
02187     IMPORT_C void LayoutText(const TRect& aParent, TResourceReader& aReader,
02188                              const CFont* aCustomFont=0);
02189 
02190     IMPORT_C void LayoutText(const TRect& aParent, 
02191                              const AknLayoutUtils::SAknLayoutText& aLayout,
02192                              const CFont* aCustomFont=0);
02193 
02194     IMPORT_C void LayoutText(const TRect& aParent,
02195                              const TAknTextLineLayout& aLayout,
02196                              const CFont* aCustomFont=0);
02197 
02198     IMPORT_C void LayoutText(const TRect& aParent, TInt fontid, 
02199                              TInt C, TInt l, TInt r, TInt B, TInt W, TInt J,
02200                              const CFont* aCustomFont=0);
02201 
02204     IMPORT_C void DrawText(CGraphicsContext& aGc, const TDesC& aText) const;
02205     
02211     IMPORT_C void DrawText(
02212         CGraphicsContext& aGc,
02213         const TDesC& aText,
02214         TBool aUseLogicalToVisualConversion ) const;
02215 
02216     IMPORT_C void DrawText(
02217         CGraphicsContext& aGc,
02218         const TDesC& aText,
02219         TBool aUseLogicalToVisualConversion,
02220         const TRgb &aColor) const;
02221                            
02222 
02223 public:
02230     IMPORT_C TRect TextRect() const;
02231     const CFont *Font() const { return iFont; }
02232     TRgb Color() const { return AKN_LAF_COLOR_STATIC(iColor); }
02233     CGraphicsContext::TTextAlign Align() const { return iAlign; }
02254     TInt BaselineOffset() const;
02255 private:
02256     TRect iTextRect;
02257     const CFont *iFont; // not owned..
02258     TInt iColor;
02259     TInt iOffset;
02260     CGraphicsContext::TTextAlign iAlign;
02261     friend class CBubbleOutlookNumberEntry;
02262     };
02263 
02272 class TAknLayoutRect
02273     {    
02274 public:
02275     IMPORT_C TAknLayoutRect();
02278     IMPORT_C void LayoutRect(const TRect &aParent, TInt aResourceId);
02279     IMPORT_C void LayoutRect(const TRect &aParent, TResourceReader &aReader);
02280     IMPORT_C void LayoutRect(const TRect &aParent, 
02281                              const AknLayoutUtils::SAknLayoutRect &aLayout);
02282 
02283     IMPORT_C void LayoutRect(const TRect &aParent,
02284                              const TAknWindowLineLayout &aLayout);
02285 
02286     IMPORT_C void LayoutRect(const TRect &aParent, 
02287                              TInt C, TInt l, TInt t, TInt r, TInt b,
02288                              TInt W, TInt H);
02289     
02298     IMPORT_C TRgb Color() const;
02301     IMPORT_C TRect Rect() const;
02302     TBool Valid() const;
02303 
02306     IMPORT_C void DrawRect(CWindowGc& aGc) const;
02307     IMPORT_C void DrawOutLineRect(CWindowGc& aGc) const;
02308     IMPORT_C void DrawImage(CBitmapContext& aGc, CFbsBitmap* aBitmap, CFbsBitmap* aMask) const;
02309 private:
02310     TInt iColor;
02311     TRect iRect;
02312     };
02313 
02317 class AknDraw 
02318     {
02319 public:
02326     IMPORT_C static void DrawEmptyList(
02327         const TRect& aRect,
02328         CWindowGc& aGc,
02329         TPtrC aText);
02330 
02337     IMPORT_C static void DrawEmptyListForSettingPage(
02338         const TRect &aRect,
02339         CWindowGc &aGc,
02340         TPtrC text); // only for setting page with empty layout.
02341 
02348     IMPORT_C static void DrawEmptyListWithFind(
02349         const TRect& aClientRect,
02350         CWindowGc& aGc,
02351         TPtrC aText); // only for fixed find pane used with single graphics listbox.
02352 
02359     IMPORT_C static void DrawEmptyListHeading(
02360         const TRect &aClientRect,
02361         CWindowGc& aGc,
02362         TPtrC aText); // only heading style lists.
02363 
02364     // The following is optimization for drawing window shadows.
02373     IMPORT_C static void DrawWindowShadow(
02374         CWindowGc& aGc,
02375         const TAknLayoutRect& aCoverRect,
02376         const TAknLayoutRect& aSecondShadowRect,
02377         const TAknLayoutRect& aFirstShadowRect,
02378         const TAknLayoutRect& aOutlineFrameRect,
02379         const TAknLayoutRect& aInsideAreaRect);
02380 
02381 public:
02382 
02401     IMPORT_C static void DrawEmptyListImpl( const TRect& aRect,
02402                                             CWindowGc& aGc,
02403                                             TPtrC aText,
02404                                             TInt aLayoutLine1,
02405                                             TInt aLayoutLine2 );
02406     
02407     };
02408 
02412 class AknDrawWithSkins
02413     {
02414 public:
02421     IMPORT_C static void DrawEmptyList(
02422         const TRect& aRect,
02423         CWindowGc& aGc,
02424         TPtrC aText,
02425         CCoeControl *aControl);
02426 
02433     IMPORT_C static void DrawEmptyListForSettingPage(
02434         const TRect &aRect,
02435         CWindowGc &aGc,
02436         TPtrC text,
02437         CCoeControl *aControl); // only for setting page with empty layout.
02438 
02445     IMPORT_C static void DrawEmptyListWithFind(
02446         const TRect& aClientRect,
02447         CWindowGc& aGc,
02448         TPtrC aText,
02449         CCoeControl *aControl); // only for fixed find pane used with single graphics listbox.
02450 
02457     IMPORT_C static void DrawEmptyListHeading(
02458         const TRect &aClientRect,
02459         CWindowGc& aGc,
02460         TPtrC aText,
02461         CCoeControl *aControl); // only heading style lists.
02462 
02463     // The following is optimization for drawing window shadows.
02472     IMPORT_C static void DrawWindowShadow(
02473         CWindowGc& aGc,
02474         const TAknLayoutRect& aCoverRect,
02475         const TAknLayoutRect& aSecondShadowRect,
02476         const TAknLayoutRect& aFirstShadowRect,
02477         const TAknLayoutRect& aOutlineFrameRect,
02478         const TAknLayoutRect& aInsideAreaRect,
02479         CCoeControl *aControl);
02480     
02481     };
02482 
02483 
02484 
02485 
02486 // Browser and calculator fonts will not be placed here. Application
02487 // can use them themselves with CEikonEnv::Static()->Font() call.
02488 IMPORT_C const CFont *LatinPlain12();
02489 IMPORT_C const CFont *LatinBold12();
02490 IMPORT_C const CFont *LatinBold13();
02491 IMPORT_C const CFont *LatinBold16(); // since 2.0
02492 IMPORT_C const CFont *LatinBold17();
02493 IMPORT_C const CFont *LatinBold19(); 
02494 IMPORT_C const CFont *NumberPlain5();
02495 IMPORT_C const CFont *ClockBold30();
02496 IMPORT_C const CFont *LatinClock14();
02497 const CFont *CalcBold21();
02498 const CFont *CalcOperBold21();
02499 const CFont *CalcOperBold13();
02500 
02501 
02502 
02503 IMPORT_C const CFont *ApacPlain12();
02504 IMPORT_C const CFont *ApacPlain16();
02505 
02506 
02533 IMPORT_C TInt CompleteWithAppPath( TDes& aFileName );
02534 
02543 TBool IsParentRelative(TInt aVal);
02544 
02552 IMPORT_C TInt DefaultInputLanguageFromUILanguage(const TInt aUiLanguage);
02553 
02562 IMPORT_C void SetKeyblockMode( TAknKeyBlockMode aMode );
02563 
02564 namespace AknDateTimeUtils
02565     {
02575     IMPORT_C void ConvertUtcTimeToHomeTime( TTime& aTime );
02576     }
02577 
02578 namespace AknLangUtils
02579     {
02585     IMPORT_C HBufC* DisplayLanguageTagL();
02586     }
02587 
02588 //  __AKNUTILS_H__
02589 #endif
02590 
02591 // End of file
02592 
02593 
02594 
02595 
02596 
02597 
02598 
02599 
02600 

Copyright © Nokia Corporation 2001-2008
Back to top