2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
19 #ifndef __FRMFRAME_H__
20 #define __FRMFRAME_H__
24 /** A rectangular frame surrounding a picture with eight smaller, square areas
25 (referred to as blobs) for moving and resizing the picture. A blob is located
26 on each corner and at the centre of each side.
28 Each blob has a visible width and an active width. The active width allows
29 easier manipulation of picture frames because the blobs may be small and difficult
30 to manipulate with a pen. The active width should be set to be at least as
31 large as the visible width.
33 A picture frame also has a set of flags which are used when drawing the frame.
34 These control the frame border visibility, whether blobs should be drawn inside
35 or outside the frame and whether the blobs should be filled using a solid
36 brush style or using a NULL brush style, causing them to appear dimmed. For
37 more information on brush styles. see CGraphicsContext::TBrushStyle.
45 /** This enumeration is used by CTextView::SetXyPosL() and by TFrameOverlay::XyPosToEdges()
46 to identify which active region of the picture frame a pixel position is in. */
49 /** Not in an active region. */
51 /** In active region around left edge. */
53 /** In active region around right edge. */
55 /** In active region around top edge. */
57 /** In active region around bottom edge. */
61 /** Frame appearance flags. */
62 enum TFrameOverlayFlags
64 /** Controls whether blobs are drawn inside or outside the frame border. */
65 EFrameOverlayFlagBlobsInternal=0x01,
66 /** Controls whether the frame border is drawn or not. */
67 EFrameOverlayFlagShowBorder=0x02,
68 /** Controls whether the three blobs at the top of the frame are drawn dimmed. */
69 EFrameOverlayFlagTopBlobsDimmed=0x04,
70 /** Controls whether the three blobs at the bottom of the frame are drawn dimmed. */
71 EFrameOverlayFlagBottomBlobsDimmed=0x08,
72 /** Controls whether the three blobs on the left hand side of the frame are drawn
74 EFrameOverlayFlagLeftBlobsDimmed=0x10,
75 /** Controls whether the three blobs on the right hand side of the frame are drawn
77 EFrameOverlayFlagRightBlobsDimmed=0x20
80 IMPORT_C TFrameOverlay();
81 IMPORT_C void SetBlobWidthInPixels(const TInt aWidth); //sets visible and active blob width
82 IMPORT_C void SetVisibleBlobWidthInPixels(const TInt aWidth); //default zero
83 IMPORT_C void SetActiveBlobWidthInPixels(const TInt aWidth); // default zero
84 IMPORT_C void SetFlags(TInt aFlag);
85 IMPORT_C void ClearFlags(TInt aFlag);
86 IMPORT_C void SetRect(const TRect& aRect);
87 IMPORT_C void XorDraw(CGraphicsContext& aGc) const;
88 IMPORT_C TInt XyPosToEdges(const TPoint& aPos) const;
89 inline TRect Rect() const; // deprecated
90 inline const TRect& RefRect() const;
91 inline TInt Flags() const;
93 TInt VisibleBlobWidth() const;
94 TInt ActiveMarginWidth() const;
95 TBool DrawLeftAndRight() const;
96 TBool DrawTopAndBottom() const;
97 void DrawDottedRectangle(CGraphicsContext& aGc,const TRect& aRect) const;
100 TInt iVisibleBlobWidth;
101 TInt iActiveBlobWidth;
106 inline TRect TFrameOverlay::Rect() const
111 inline const TRect& TFrameOverlay::RefRect() const
116 TInt TFrameOverlay::Flags() const