2 * Copyright (c) 2019 Samsung Electronics Co., Ltd.
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.
17 #ifndef NOTIFICATION_EX_SHARED_FILE_H_
18 #define NOTIFICATION_EX_SHARED_FILE_H_
20 #include <security-manager.h>
28 #include "notification-ex/abstract_item.h"
31 #define EXPORT_API __attribute__((visibility("default")))
34 namespace notification {
37 class EXPORT_API SharedFile {
40 virtual ~SharedFile();
42 bool IsPrivatePath(std::string path) const;
43 std::string GetDataPath(std::string app_id, std::string path) const;
44 int SetPrivateSharing(std::list<std::shared_ptr<AbstractItem>> item,
45 std::multimap<std::string, std::string> receiver_group_map);
46 int UpdatePrivateSharing(std::shared_ptr<AbstractItem>item,
47 std::multimap<std::string, std::string> receiver_group_map);
48 int RemovePrivateSharing(std::shared_ptr<AbstractItem>item,
49 std::multimap<std::string, std::string> receiver_group_map);
50 int CopyPrivateFile(std::shared_ptr<item::AbstractItem>added_item);
59 std::list<std::string> noti_id_list;
60 std::list<std::string> shared_file_list;
61 std::list<std::string> receiver_group_list;
67 std::string target_id;
69 const char* GetLastIndex(const char* path, const char* search) const;
70 bool MakeDir(const char* path);
71 std::string GetDir(std::string path);
72 int CopyFile(const char* source, const char* dest);
73 std::vector<char*> ConvertListToArray(const std::list<std::string>& data);
74 SharingData FindSharingData(std::string appid);
75 int SetSharingData(SharingData sharing_data,
76 std::list<std::string> new_shared_file_list,
77 std::list<std::string> new_receiver_group_list,
78 std::multimap<std::string, std::string> receiver_group_map);
79 int UnsetSharingData(SharingData sharing_data,
80 std::multimap<std::string, std::string> receiver_group_map);
82 std::list<SharingData> sharing_data_list_;
83 std::list<SharingTarget> sharing_target_list_;
84 }; // class SharedFile
87 } // namespace notification
89 #endif // NOTIFICATION_EX_SHARED_FILE_H_