Fixed regex LIR to be x64 compliant (bug 514548, r=lw).
[mozilla-central.git] / layout / generic / nsBulletFrame.h
blob27a3cdb2a2cde2bf55c29c4806b9ff64c798b3b5
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is Mozilla Communicator client code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
24 * Alternatively, the contents of this file may be used under the terms of
25 * either of the GNU General Public License Version 2 or later (the "GPL"),
26 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
38 /* rendering object for list-item bullets */
40 #ifndef nsBulletFrame_h___
41 #define nsBulletFrame_h___
43 #include "nsFrame.h"
44 #include "nsStyleContext.h"
46 #include "imgIRequest.h"
47 #include "imgIDecoderObserver.h"
49 /**
50 * A simple class that manages the layout and rendering of html bullets.
51 * This class also supports the CSS list-style properties.
53 class nsBulletFrame : public nsFrame {
54 public:
55 nsBulletFrame(nsStyleContext* aContext) : nsFrame(aContext) {}
56 virtual ~nsBulletFrame();
58 // nsIFrame
59 virtual void Destroy();
60 NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
61 const nsRect& aDirtyRect,
62 const nsDisplayListSet& aLists);
63 virtual nsIAtom* GetType() const;
64 virtual void DidSetStyleContext(nsStyleContext* aOldStyleContext);
65 #ifdef NS_DEBUG
66 NS_IMETHOD GetFrameName(nsAString& aResult) const;
67 #endif
69 // nsIHTMLReflow
70 NS_IMETHOD Reflow(nsPresContext* aPresContext,
71 nsHTMLReflowMetrics& aMetrics,
72 const nsHTMLReflowState& aReflowState,
73 nsReflowStatus& aStatus);
74 virtual nscoord GetMinWidth(nsIRenderingContext *aRenderingContext);
75 virtual nscoord GetPrefWidth(nsIRenderingContext *aRenderingContext);
77 // nsBulletFrame
78 PRInt32 SetListItemOrdinal(PRInt32 aNextOrdinal, PRBool* aChanged);
81 NS_IMETHOD OnStartContainer(imgIRequest *aRequest, imgIContainer *aImage);
82 NS_IMETHOD OnDataAvailable(imgIRequest *aRequest,
83 PRBool aCurrentFrame,
84 const nsIntRect *aRect);
85 NS_IMETHOD OnStopDecode(imgIRequest *aRequest,
86 nsresult aStatus,
87 const PRUnichar *aStatusArg);
88 NS_IMETHOD FrameChanged(imgIContainer *aContainer,
89 nsIntRect *aDirtyRect);
91 /* get list item text, without '.' */
92 static PRBool AppendCounterText(PRInt32 aListStyleType,
93 PRInt32 aOrdinal,
94 nsString& aResult);
96 /* get list item text, with '.' */
97 PRBool GetListItemText(const nsStyleList& aStyleList,
98 nsString& aResult);
100 void PaintBullet(nsIRenderingContext& aRenderingContext, nsPoint aPt,
101 const nsRect& aDirtyRect);
103 virtual PRBool IsEmpty();
104 virtual PRBool IsSelfEmpty();
106 protected:
107 void GetDesiredSize(nsPresContext* aPresContext,
108 nsIRenderingContext *aRenderingContext,
109 nsHTMLReflowMetrics& aMetrics);
111 void GetLoadGroup(nsPresContext *aPresContext, nsILoadGroup **aLoadGroup);
113 nsMargin mPadding;
114 nsCOMPtr<imgIRequest> mImageRequest;
115 nsCOMPtr<imgIDecoderObserver> mListener;
117 nsSize mIntrinsicSize;
118 nsSize mComputedSize;
119 PRInt32 mOrdinal;
120 PRBool mTextIsRTL;
123 #endif /* nsBulletFrame_h___ */