2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 #ifndef WRTDEVICEAPIS_FILESYSTEM_IMANAGER_H_
17 #define WRTDEVICEAPIS_FILESYSTEM_IMANAGER_H_
22 #include <dpl/noncopyable.h>
23 #include <Commons/EventReceiver.h>
24 #include <Filesystem/EventResolve.h>
25 #include <Filesystem/EventCopy.h>
26 #include <Filesystem/EventMove.h>
27 #include <Filesystem/EventRemove.h>
28 #include <Filesystem/EventFind.h>
29 #include <Filesystem/Enums.h>
30 #include <Filesystem/INode.h>
31 #include <Filesystem/IPath.h>
33 namespace WrtDeviceApis {
34 namespace Filesystem {
37 typedef std::vector<IPathPtr> LocationPaths;
38 typedef std::vector<LocationType> LocationTypes;
41 public Commons::EventRequestReceiver<EventResolve>,
42 public Commons::EventRequestReceiver<EventCopy>,
43 public Commons::EventRequestReceiver<EventMove>,
44 public Commons::EventRequestReceiver<EventRemove>,
45 public Commons::EventRequestReceiver<EventFind>
48 static IManager& getInstance();
50 virtual ~IManager() = 0;
54 * @return Valid path or empty shared pointer.
56 virtual IPathPtr getBasePath() const = 0;
59 * Gets path for specified location type.
60 * @param type Location type @see WrtDeviceApis::Api::Filesystem::LocationType.
61 * @return Valid path or empty shared pointer.
63 virtual IPathPtr getLocationPath(LocationType type) const = 0;
66 * Gets paths to default locations.
67 * @return Paths to predefined virtual locations.
69 virtual LocationPaths getLocationPaths() const = 0;
72 * Gets locations supported by platform.
73 * @return Supported locations.
75 virtual LocationTypes getLocations() const = 0;
78 * Gets filesystem node.
79 * @param event Get node event @see Api::Filesystem::EventGetNode.
80 * @remarks Asynchronous.
82 virtual void getNode(const EventResolvePtr& event) = 0;
85 * Gets maximum length of filesystem path.
86 * @return Maximum path length.
88 virtual std::size_t getMaxPathLength() const = 0;
91 * Copies node to specified destination.
92 * @param event Copy node event @see Api::Filesystem::EventCopy.
93 * @remarks Asynchronous.
95 virtual void copy(const EventCopyPtr& event) = 0;
98 * Moves node to specified destination.
99 * @param event Move node event @see Api::Filesystem::EventMove.
100 * @remarks Asynchronous.
102 virtual void move(const EventMovePtr& event) = 0;
106 * @param event Remove node event @see Api::Filesystem::EventRemove.
107 * @remarks Asynchronous.
109 virtual void remove(const EventRemovePtr& event) = 0;
113 * @param event Find nodes event @see Api::Filesystem::EventFind.
114 * @remarks Asynchronous.
116 virtual void find(const EventFindPtr& event) = 0;
119 * Checks if node at specified path has supplied access rights.
120 * @param path Path to the node.
121 * @param accessType Access right(s) to check @see AccessType. Multiple values
122 * can be passed using OR operator.
123 * @return True if specified node has supplied access rights, false otherwise.
125 virtual bool access(const IPathPtr& path,
126 int accessType) const = 0;
128 virtual void addOpenedNode(const INodePtr& node) = 0;
129 virtual void removeOpenedNode(const INodePtr& node) = 0;
130 virtual bool checkIfOpened(const IPathPtr& path) const = 0;
135 virtual void OnRequestReceived(const EventResolvePtr& event) = 0;
136 virtual void OnRequestReceived(const EventCopyPtr& event) = 0;
137 virtual void OnRequestReceived(const EventMovePtr& event) = 0;
138 virtual void OnRequestReceived(const EventRemovePtr& event) = 0;
139 virtual void OnRequestReceived(const EventFindPtr& event) = 0;
146 #endif // WRTDEVICEAPIS_FILESYSTEM_IMANAGER_H_