Wed, 31 Dec 2014 06:55:50 +0100
Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef nsTreeImageListener_h__ |
michael@0 | 7 | #define nsTreeImageListener_h__ |
michael@0 | 8 | |
michael@0 | 9 | #include "nsString.h" |
michael@0 | 10 | #include "nsCOMPtr.h" |
michael@0 | 11 | #include "nsITreeColumns.h" |
michael@0 | 12 | #include "nsTreeBodyFrame.h" |
michael@0 | 13 | #include "mozilla/Attributes.h" |
michael@0 | 14 | |
michael@0 | 15 | // This class handles image load observation. |
michael@0 | 16 | class nsTreeImageListener MOZ_FINAL : public imgINotificationObserver |
michael@0 | 17 | { |
michael@0 | 18 | public: |
michael@0 | 19 | nsTreeImageListener(nsTreeBodyFrame *aTreeFrame); |
michael@0 | 20 | ~nsTreeImageListener(); |
michael@0 | 21 | |
michael@0 | 22 | NS_DECL_ISUPPORTS |
michael@0 | 23 | NS_DECL_IMGINOTIFICATIONOBSERVER |
michael@0 | 24 | |
michael@0 | 25 | NS_IMETHOD ClearFrame(); |
michael@0 | 26 | |
michael@0 | 27 | friend class nsTreeBodyFrame; |
michael@0 | 28 | |
michael@0 | 29 | protected: |
michael@0 | 30 | void UnsuppressInvalidation() { mInvalidationSuppressed = false; } |
michael@0 | 31 | void Invalidate(); |
michael@0 | 32 | void AddCell(int32_t aIndex, nsITreeColumn* aCol); |
michael@0 | 33 | |
michael@0 | 34 | private: |
michael@0 | 35 | nsTreeBodyFrame* mTreeFrame; |
michael@0 | 36 | |
michael@0 | 37 | // A guard that prevents us from recursive painting. |
michael@0 | 38 | bool mInvalidationSuppressed; |
michael@0 | 39 | |
michael@0 | 40 | class InvalidationArea { |
michael@0 | 41 | public: |
michael@0 | 42 | InvalidationArea(nsITreeColumn* aCol); |
michael@0 | 43 | ~InvalidationArea() { delete mNext; } |
michael@0 | 44 | |
michael@0 | 45 | friend class nsTreeImageListener; |
michael@0 | 46 | |
michael@0 | 47 | protected: |
michael@0 | 48 | void AddRow(int32_t aIndex); |
michael@0 | 49 | nsITreeColumn* GetCol() { return mCol.get(); } |
michael@0 | 50 | int32_t GetMin() { return mMin; } |
michael@0 | 51 | int32_t GetMax() { return mMax; } |
michael@0 | 52 | InvalidationArea* GetNext() { return mNext; } |
michael@0 | 53 | void SetNext(InvalidationArea* aNext) { mNext = aNext; } |
michael@0 | 54 | |
michael@0 | 55 | private: |
michael@0 | 56 | nsCOMPtr<nsITreeColumn> mCol; |
michael@0 | 57 | int32_t mMin; |
michael@0 | 58 | int32_t mMax; |
michael@0 | 59 | InvalidationArea* mNext; |
michael@0 | 60 | }; |
michael@0 | 61 | |
michael@0 | 62 | InvalidationArea* mInvalidationArea; |
michael@0 | 63 | }; |
michael@0 | 64 | |
michael@0 | 65 | #endif // nsTreeImageListener_h__ |