sbFileSystemChange.h
Go to the documentation of this file.
1 /*
2 //
3 // Copyright(c) 2005-2009 POTI, Inc.
4 // http://songbirdnest.com
5 //
6 // This file may be licensed under the terms of of the
7 // GNU General Public License Version 2 (the "GPL").
8 //
9 // Software distributed under the License is distributed
10 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
11 // express or implied. See the GPL for the specific language
12 // governing rights and limitations.
13 //
14 // You should have received a copy of the GPL along with this
15 // program. If not, go to http://www.gnu.org/licenses/gpl.html
16 // or write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 //
19 // END SONGBIRD GPL
20 //
21 */
22 
23 #ifndef sbFileSystemChange_h_
24 #define sbFileSystemChange_h_
25 
26 #include <nsAutoPtr.h>
27 #include <nsStringAPI.h>
29 
30 class sbFileSystemNode;
31 
32 
33 //
34 // \brief Abstract class for changes.
35 //
37 {
38 public:
40  virtual ~sbFileSystemChange();
41 
43 
44  //
45  // \brief Getter and setter for the change type of the change.
46  //
47  NS_IMETHOD SetChangeType(EChangeType aChangeType);
48  NS_IMETHOD GetChangeType(EChangeType *aChangeType);
49 
50 protected:
52 };
53 
54 //------------------------------------------------------------------------------
55 
56 //
57 // \brief Simple class for mapping a change type and a file system node.
58 // This class is used to determine diffs between file system snapshots.
59 //
61 {
62 public:
65  virtual ~sbFileSystemNodeChange();
66 
67  //
68  // \brief Getter and setter for the changed node.
69  //
70  nsresult SetNode(sbFileSystemNode *aNode);
71  nsresult GetNode(sbFileSystemNode **aRetVal);
72 
73 private:
74  nsRefPtr<sbFileSystemNode> mNode;
75 };
76 
77 //------------------------------------------------------------------------------
78 
80 {
81 public:
83  sbFileSystemPathChange(const nsAString & aChangePath,
84  EChangeType aChangeType);
85  virtual ~sbFileSystemPathChange();
86 
87  //
88  // \brief Getter and setter for the changed path.
89  //
90  nsresult SetChangePath(const nsAString & aChangePath);
91  nsresult GetChangePath(nsAString & aChangePath);
92 
93 private:
94  nsString mChangePath;
95 };
96 
97 #endif // sbFileSystemChange_h_
98 
nsresult SetNode(sbFileSystemNode *aNode)
NS_DECL_ISUPPORTS NS_IMETHOD SetChangeType(EChangeType aChangeType)
nsresult GetChangePath(nsAString &aChangePath)
NS_IMETHOD GetChangeType(EChangeType *aChangeType)
nsresult SetChangePath(const nsAString &aChangePath)
nsresult GetNode(sbFileSystemNode **aRetVal)