00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __AKNPOPUPLAYOUT__
00024 #define __AKNPOPUPLAYOUT__
00025
00026 #include <aknutils.h>
00027 #include <e32std.h>
00028
00029 struct TAknPopupWindowLayoutDef;
00030 class CEikListBox;
00031 class CAknPopupHeadingPane;
00032 class CWindowGc;
00033 class CCoeControl;
00034 class CEikonEnv;
00035 class TAknWindowComponentLayout;
00036
00037 const TInt EAknPopupLayoutsDynamic = 0x80;
00038 const TInt EAknPopupLayoutsFind = 0x100;
00039
00058 struct TAknPopupLayoutsNode;
00059 struct TAknPopupLayoutsNode
00060 {
00061 TAknPopupLayoutsNode *iNext;
00062 TInt iId;
00063 CCoeControl *iControl;
00064 };
00065 enum TAknPopupLayoutsNodeList
00066 {
00067 EListNode = 0x5555,
00068 EHeadingNode,
00069 EWindowOwningNode,
00070 EMessageBoxNode,
00071 EFindBoxNode
00072 };
00073
00074 class AknPopupLayouts
00075 {
00076 public:
00085 enum TAknPopupLayouts
00086 {
00087
00088 EMenuWindow,
00089 EMenuGraphicWindow,
00090 EMenuGraphicHeadingWindow,
00091 EMenuDoubleWindow,
00092 EMenuDoubleLargeGraphicWindow,
00093 EPopupSNotePopupWindow,
00094 EMenuUnknownColumnWindow,
00095 EMenuUnknownFormattedCellWindow,
00096
00097
00098
00099
00100 EDynMenuWindow = EMenuWindow + 0x80,
00101 EDynMenuGraphicWindow,
00102 EDynMenuGraphicHeadingWindow,
00103 EDynMenuDoubleWindow,
00104 EDynMenuDoubleLargeGraphicWindow
00105 };
00106
00107 public:
00108
00109
00117 IMPORT_C static void HandleSizeChanged(TAknPopupWindowLayoutDef &aDef,
00118 TAknPopupLayouts aLayout,
00119 TAknPopupLayoutsNode *aListOfControls);
00120 IMPORT_C static void HandleSizeChanged(TAknPopupWindowLayoutDef &aDef,
00121 TAknPopupLayouts aLayout,
00122 CAknPopupHeadingPane *aHeadingOrNull,
00123 CEikListBox *aListBox,
00124 CCoeControl *aWindowOwningControl);
00128 IMPORT_C static void HandleDraw(CEikonEnv* aEikEnv,
00129 CWindowGc &aGc,
00130 const TAknPopupWindowLayoutDef &aDef,
00131 CEikListBox *aListBox,
00132 CAknPopupHeadingPane *aHeadingOrNull);
00133
00134
00135 public:
00139 IMPORT_C static void ModifyWindowGraphicForHeading(TAknPopupWindowLayoutDef &aDef);
00140 IMPORT_C static void ModifyWindowGraphicForMessageBox(TAknPopupWindowLayoutDef &aDef, TInt aNumOfLines);
00141
00142 public:
00146 IMPORT_C static void CalcPopupMenuWindow(TAknPopupWindowLayoutDef &aDef,
00147 TRect aClientRect,
00148 TInt aNumberOfLinesInListBox);
00152 IMPORT_C static void CalcPopupMenuGraphicWindow(TAknPopupWindowLayoutDef &aDef,
00153 TRect aClientRect,
00154 TInt aNumberOfLinesInListBox);
00158 IMPORT_C static void CalcPopupMenuGraphicHeadingWindow(TAknPopupWindowLayoutDef &aDef,
00159 TRect aClientRect,
00160 TInt aNumberOfLinesInListBox);
00164 IMPORT_C static void CalcPopupMenuDoubleWindow(TAknPopupWindowLayoutDef &aDef,
00165 TRect aClientRect,
00166 TInt aNumberOfLinesInListBox);
00170 IMPORT_C static void CalcPopupMenuDoubleLargeGraphicWindow(TAknPopupWindowLayoutDef &aDef,
00171 TRect aClientRect,
00172 TInt aNumberOfLinesInListBox);
00176 IMPORT_C static void CalcPopupSNoteGroupWindow(TAknPopupWindowLayoutDef &aDef,
00177 TRect aClientRect,
00178 TInt aNumberOfLinesInListBox);
00179
00183 IMPORT_C static void SetupMenuPopupWindow(TAknPopupWindowLayoutDef &aDef,
00184 TInt aNumberOfLinesInListBox,
00185 TBool aHeading);
00189 IMPORT_C static void SetupPopupMenuGraphicWindow(TAknPopupWindowLayoutDef &aDef,
00190 TInt aNumberOfLinesInListBox,
00191 TBool aHeading);
00195 IMPORT_C static void SetupPopupMenuGraphicHeadingWindow(TAknPopupWindowLayoutDef &aDef,
00196 TInt aNumberOfLinesInListBox,
00197 TBool aHeading);
00201 IMPORT_C static void SetupPopupMenuDoubleWindow(TAknPopupWindowLayoutDef &aDef,
00202 TInt aNumberOfLinesInListBox,
00203 TBool aHeading);
00207 IMPORT_C static void SetupImageSelectionMenuPopupWindow(TAknPopupWindowLayoutDef &aDef,
00208 TInt num,
00209 TBool heading);
00213 IMPORT_C static void SetupPopupSNoteGroupWindow(TAknPopupWindowLayoutDef &aDef,
00214 TInt num,
00215 TBool heading);
00216
00217
00218 public:
00219 IMPORT_C static void HandleSizeAndPositionOfComponents(const TAknPopupWindowLayoutDef &aDef,
00220 CCoeControl *aContentInsidePopup,
00221 CAknPopupHeadingPane *aHeadingOrNull);
00222 IMPORT_C static void SetupDefaults(TAknPopupWindowLayoutDef &aDef);
00223 public:
00227 IMPORT_C static TRect WindowRect(TAknPopupWindowLayoutDef &aDef);
00231 IMPORT_C static TRect MenuRect(TAknPopupWindowLayoutDef &aDef);
00235 IMPORT_C static void CheckRange(TInt &aValue, TInt aMin, TInt aMax);
00239 IMPORT_C static void MenuPopupWindowGraphics(TAknPopupWindowLayoutDef &aDef);
00240
00241 static TRect RectFromLayout(TRect aParent, const TAknWindowComponentLayout &aComponentLayout);
00242 };
00243
00249 struct TAknPopupWindowLayoutDef
00250 {
00251 EXPORT_C TAknPopupWindowLayoutDef();
00252 TAknLayoutRect iListRect;
00253 TAknLayoutRect iHeadingRect;
00254
00255 TAknLayoutRect iCover;
00256 TAknLayoutRect iSecond;
00257 TAknLayoutRect iFirst;
00258 TAknLayoutRect iOutline;
00259 TAknLayoutRect iInside;
00260
00261 TAknLayoutRect iVertLineExt1;
00262 TAknLayoutRect iVertLineExt2;
00263
00264
00265 TRect iWindowRect;
00266
00267
00268 TPoint iPopupMenuWindowOffset;
00269 TInt iMaximumHeight;
00270 };
00271
00272 #endif
00273
00274
00275