sbDeviceLibraryMediaSyncSettings.h
Go to the documentation of this file.
1 /* vim: set sw=2 :miv */
2 /*
3  *=BEGIN SONGBIRD GPL
4  *
5  * This file is part of the Songbird web player.
6  *
7  * Copyright(c) 2005-2011 POTI, Inc.
8  * http://www.songbirdnest.com
9  *
10  * This file may be licensed under the terms of of the
11  * GNU General Public License Version 2 (the ``GPL'').
12  *
13  * Software distributed under the License is distributed
14  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
15  * express or implied. See the GPL for the specific language
16  * governing rights and limitations.
17  *
18  * You should have received a copy of the GPL along with this
19  * program. If not, go to http://www.gnu.org/licenses/gpl.html
20  * or write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22  *
23  *=END SONGBIRD GPL
24  */
25 
26 #ifndef SBDEVICELIBRARYMEDIASYNCSETTINGS_H_
27 #define SBDEVICELIBRARYMEDIASYNCSETTINGS_H_
28 
29 // Mozilla includes
30 #include <nsDataHashtable.h>
31 #include <nsStringAPI.h>
32 #include <nsTArray.h>
33 
34 // Somgbird includes
35 #include <sbIDeviceLibraryMediaSyncSettings.h>
36 
37 // Forwards
38 struct PRLock;
39 class sbIDevice;
41 
43 {
44 public:
45  // This allows our owner to much with us within its lock
49 
50  nsresult Read(sbIDevice * aDevice);
51  typedef nsDataHashtable<nsISupportsHashKey, PRBool> PlaylistSelection;
52 
53 private:
55  PRUint32 aMediaType,
56  PRLock * aLock);
58 
63  sbDeviceLibrarySyncSettings * aSyncSettings,
64  PRUint32 aMediaType,
65  PRLock * aLock);
66  nsresult Assign(sbDeviceLibraryMediaSyncSettings * aSettings);
67  nsresult CreateCopy(sbDeviceLibraryMediaSyncSettings ** aSettings);
68  void SetSyncSettings(sbDeviceLibrarySyncSettings * aSettings) {
69  mSyncSettings = aSettings;
70  }
71  nsresult GetMgmtTypeNoLock(PRUint32 * aSyncMgmtType);
72  nsresult GetSyncPlaylistsNoLock(nsIArray ** aSyncPlaylists);
73  nsresult GetSelectedPlaylistsNoLock(nsIArray ** aSelectedPlaylists);
77  PRUint32 mSyncMgmtType;
78  PRUint32 mLastActiveSyncMgmtType;
79  PRUint32 mMediaType;
80  PlaylistSelection mPlaylistsSelection;
81  nsString mSyncFolder;
82  nsCOMPtr<nsIFile> mSyncFromFolder;
83  bool mImport;
84  PRLock * mLock;
85  // Non-owning reference to our owner. We should never live past
86  sbDeviceLibrarySyncSettings * mSyncSettings;
87 };
88 
89 #endif /* SBDEVICELIBRARYMEDIASYNCSETTINGS_H_ */
nsresult CreateCopy(sbDeviceLibrarySyncSettings **aSettings)
NS_DECL_ISUPPORTS NS_DECL_SBIDEVICELIBRARYSYNCSETTINGS nsresult Assign(sbDeviceLibrarySyncSettings *aSource)
static sbDeviceLibrarySyncSettings * New(nsID const &aDeviceID, nsAString const &aDeviceLibraryGuid)
nsDataHashtable< nsISupportsHashKey, PRBool > PlaylistSelection
nsresult Read(sbIDevice *aDevice)