123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- //
- // CCGlobal.h
- // Nextcloud
- //
- // Created by Marino Faggiana on 13/10/14.
- // Copyright (c) 2014 Marino Faggiana. All rights reserved.
- //
- // Author Marino Faggiana <marino.faggiana@nextcloud.com>
- //
- // This program is free software: you can redistribute it and/or modify
- // it under the terms of the GNU General Public License as published by
- // the Free Software Foundation, either version 3 of the License, or
- // (at your option) any later version.
- //
- // This program is distributed in the hope that it will be useful,
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- // GNU General Public License for more details.
- //
- // You should have received a copy of the GNU General Public License
- // along with this program. If not, see <http://www.gnu.org/licenses/>.
- //
- #import <UIKit/UIKit.h>
- #ifndef EXTENSION
- //AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
- //#define app ((AppDelegate *)[[UIApplication sharedApplication] delegate])
- //dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
- //dispatch_async(dispatch_get_main_queue(), ^{
- //dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.3 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) {
- //DispatchQueue.main.async
- //DispatchQueue.main.asyncAfter(deadline: .now() + 0.1)
- //DispatchQueue.global().async
- //NSString *language = [[NSLocale preferredLanguages] objectAtIndex:0];
- //NSDictionary *languageDic = [NSLocale componentsFromLocaleIdentifier:language];
- //NSString *languageCode = [languageDic objectForKey:@"kCFLocaleLanguageCodeKey"];
- //#if targetEnvironment(simulator)
- //#endif
- //#if TARGET_OS_SIMULATOR
- //#endif
- //if indexPath.section < collectionView.numberOfSections && indexPath.row < collectionView.numberOfItems(inSection: indexPath.section)
- #define CALL_ORIGIN NSLog(@"Origin: [%@]", [[[[NSThread callStackSymbols] objectAtIndex:1] componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"[]"]] objectAtIndex:1])
- #endif
- // Constants to identify the different permissions of a file
- #define k_permission_shared @"S"
- #define k_permission_can_share @"R"
- #define k_permission_mounted @"M"
- #define k_permission_file_can_write @"W"
- #define k_permission_can_create_file @"C"
- #define k_permission_can_create_folder @"K"
- #define k_permission_can_delete @"D"
- #define k_permission_can_rename @"N"
- #define k_permission_can_move @"V"
- // Metadata : Status
- //
- // 1) wait download/upload
- // 2) in download/upload
- // 3) downloading/uploading
- // 4) done or error
- //
- // Selector
- #define selectorDownloadFile @"downloadFile"
- #define selectorDownloadAllFile @"downloadAllFile"
- #define selectorReadFile @"readFile"
- #define selectorListingFavorite @"listingFavorite"
- #define selectorLoadFileView @"loadFileView"
- #define selectorLoadFileQuickLook @"loadFileQuickLook"
- #define selectorLoadCopy @"loadCopy"
- #define selectorLoadOffline @"loadOffline"
- #define selectorOpenIn @"openIn"
- #define selectorUploadAutoUpload @"uploadAutoUpload"
- #define selectorUploadAutoUploadAll @"uploadAutoUploadAll"
- #define selectorUploadFile @"uploadFile"
- #define selectorSaveAlbum @"saveAlbum"
- // Metadata : FileType
- #define k_metadataTypeFile_audio @"audio"
- #define k_metadataTypeFile_compress @"compress"
- #define k_metadataTypeFile_directory @"directory"
- #define k_metadataTypeFile_document @"document"
- #define k_metadataTypeFile_image @"image"
- #define k_metadataTypeFile_unknown @"unknow"
- #define k_metadataTypeFile_video @"video"
- #define k_metadataTypeFile_imagemeter @"imagemeter"
- // Filename Mask and Type
- #define k_keyFileNameMask @"fileNameMask"
- #define k_keyFileNameType @"fileNameType"
- #define k_keyFileNameAutoUploadMask @"fileNameAutoUploadMask"
- #define k_keyFileNameAutoUploadType @"fileNameAutoUploadType"
- #define k_keyFileNameOriginal @"fileNameOriginal"
- #define k_keyFileNameOriginalAutoUpload @"fileNameOriginalAutoUpload"
- // Activity
- #define k_activityVerboseDefault 0
- #define k_activityVerboseHigh 1
- #define k_activityTypeInfo @"info"
- #define k_activityTypeSuccess @"success"
- #define k_activityTypeFailure @"error"
- #define k_activityDebugActionDownload @"Download"
- #define k_activityDebugActionDownloadPicker @"Download Picker"
- #define k_activityDebugActionUpload @"Upload"
- #define k_activityDebugActionUploadPicker @"Upload Picker"
- #define k_activityDebugActionUploadShare @"Upload Share"
- #define k_activityDebugActionAutoUpload @"Auto Upload"
- #define k_activityDebugActionReadFolder @"Read Folder"
- #define k_activityDebugActionListingFavorites @"Listing Favorites"
- #define k_activityDebugActionCreateFolder @"Create Folder"
- #define k_activityDebugActionDeleteFileFolder @"Delete File-Folder"
- #define k_activityDebugActionGetNotification @"Get Notification Server"
- #define k_activityDebugActionSubscribingServerPush @"Subscribing Server Push"
- #define k_activityDebugActionUnsubscribingServerPush @"Unsubscribing Server Push"
- #define k_activityDebugActionSubscribingPushProxy @"Subscribing Push Proxy"
- #define k_activityDebugActionUnsubscribingPushProxy @"Unsubscribing Push Proxy"
- #define k_activityDebugActionCapabilities @"Capabilities Of Server"
- #define k_activityDebugActionEndToEndEncryption @"End To End Encryption "
- //Share permission
- //permissions - (int) 1 = read; 2 = update; 4 = create; 8 = delete; 16 = share; 31 = all (default: 31, for public shares: 1)
- #define k_read_share_permission 1
- #define k_update_share_permission 2
- #define k_create_share_permission 4
- #define k_delete_share_permission 8
- #define k_share_share_permission 16
- #define k_min_file_share_permission 1
- #define k_max_file_share_permission 19
- #define k_min_folder_share_permission 1
- #define k_max_folder_share_permission 31
- #define k_default_file_remote_share_permission_no_support_share_option 3
- #define k_default_folder_remote_share_permission_no_support_share_option 15
- // Notification Center
- #define k_notificationCenter_applicationDidEnterBackground @"applicationDidEnterBackground"
- #define k_notificationCenter_applicationWillEnterForeground @"applicationWillEnterForeground"
- #define k_notificationCenter_initializeMain @"initializeMain"
- #define k_notificationCenter_setTitleMain @"setTitleMain"
- #define k_notificationCenter_changeTheming @"changeTheming"
- #define k_notificationCenter_changeUserProfile @"changeUserProfile"
- #define k_notificationCenter_richdocumentGrabFocus @"richdocumentGrabFocus"
- #define k_notificationCenter_reloadDataNCShare @"reloadDataNCShare"
- #define k_notificationCenter_closeRichWorkspaceWebView @"closeRichWorkspaceWebView"
- #define k_notificationCenter_reloadDataSource @"reloadDataSource" // userInfo: ocId?, serverUrl?
- #define k_notificationCenter_reloadDataSourceNetworkForced @"reloadDataSourceNetworkForced" // userInfo: serverUrl?
- #define k_notificationCenter_changeStatusFolderE2EE @"changeStatusFolderE2EE" // userInfo: serverUrl
- #define k_notificationCenter_downloadStartFile @"downloadStartFile" // userInfo: ocId
- #define k_notificationCenter_downloadedFile @"downloadedFile" // userInfo: ocId, selector, errorCode, errorDescription
- #define k_notificationCenter_downloadCancelFile @"downloadCancelFile" // userInfo: ocId
- #define k_notificationCenter_uploadStartFile @"uploadStartFile" // userInfo: ocId
- #define k_notificationCenter_uploadedFile @"uploadedFile" // userInfo: ocId, ocIdTemp, errorCode, errorDescription
- #define k_notificationCenter_uploadCancelFile @"uploadCancelFile" // userInfo: ocId
- #define k_notificationCenter_progressTask @"progressTask" // userInfo: account, ocId, serverUrl, status, progress, totalBytes, totalBytesExpected
- #define k_notificationCenter_createFolder @"createFolder" // userInfo: ocId
- #define k_notificationCenter_deleteFile @"deleteFile" // userInfo: ocId, fileNameView, typeFile, onlyLocal
- #define k_notificationCenter_renameFile @"renameFile" // userInfo: ocId, errorCode, errorDescription
- #define k_notificationCenter_moveFile @"moveFile" // userInfo: ocId, serverUrlTo
- #define k_notificationCenter_copyFile @"copyFile" // userInfo: ocId, serverUrlFrom
- #define k_notificationCenter_favoriteFile @"favoriteFile" // userInfo: ocId
- #define k_notificationCenter_menuSearchTextPDF @"menuSearchTextPDF"
- #define k_notificationCenter_menuSaveLivePhoto @"menuSaveLivePhoto" // userInfo: ocId, ocIdMov
- #define k_notificationCenter_menuDetailClose @"menuDetailClose"
|