-
Notifications
You must be signed in to change notification settings - Fork 509
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2395 from meganz/release/v3.7.8
Release/v3.7.8
- Loading branch information
Showing
63 changed files
with
2,704 additions
and
535 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/** | ||
* @file MEGABanner.h | ||
* @brief Represents an user banner in MEGA | ||
* | ||
* (c) 2013-2014 by Mega Limited, Auckland, New Zealand | ||
* | ||
* This file is part of the MEGA SDK - Client Access Engine. | ||
* | ||
* Applications using the MEGA API must present a valid application key | ||
* and comply with the the rules set forth in the Terms of Service. | ||
* | ||
* The MEGA SDK 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. | ||
* | ||
* @copyright Simplified (2-clause) BSD License. | ||
* | ||
* You should have received a copy of the license along with this | ||
* program. | ||
*/ | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@interface MEGABanner : NSObject | ||
|
||
/** | ||
* @brief Returns the id of the MEGABanner | ||
* | ||
* @return Id of this banner | ||
*/ | ||
@property (nonatomic, readonly) NSUInteger identifier; | ||
|
||
/** | ||
* @brief Returns the title associated with the MEGABanner object | ||
* | ||
* @return Title associated with the MEGABanner object | ||
*/ | ||
@property (nonatomic, readonly, nullable) NSString *title; | ||
|
||
/** | ||
* @brief Returns the description associated with the MEGABanner object | ||
* | ||
* @return Description associated with the MEGABanner object | ||
*/ | ||
@property (nonatomic, readonly, nullable) NSString *description; | ||
|
||
/** | ||
* @brief Returns the filename of the image used by the MegaBanner object | ||
* | ||
* @return Filename of the image used by the MegaBanner object | ||
*/ | ||
@property (nonatomic, readonly, nullable) NSString *imageFilename; | ||
|
||
/** | ||
* @brief Returns the filename of the background image used by the MEGABanner object | ||
* | ||
* @return Filename of the background image used by the MEGABanner object | ||
*/ | ||
@property (nonatomic, readonly, nullable) NSString *backgroundImageFilename; | ||
|
||
/** | ||
* @brief Returns the URL where images are located | ||
* | ||
* @return URL where images are located | ||
*/ | ||
@property (nonatomic, readonly, nullable) NSString *imageLocationURLString; | ||
|
||
/** | ||
* @brief Returns the URL associated with the MEGABanner object | ||
* | ||
* @return URL associated with the MEGABanner object | ||
*/ | ||
@property (nonatomic, readonly, nullable) NSString *URLString; | ||
|
||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/** | ||
* @file MEGABanner.mm | ||
* @brief Represents an user banner in MEGA | ||
* | ||
* (c) 2013-2014 by Mega Limited, Auckland, New Zealand | ||
* | ||
* This file is part of the MEGA SDK - Client Access Engine. | ||
* | ||
* Applications using the MEGA API must present a valid application key | ||
* and comply with the the rules set forth in the Terms of Service. | ||
* | ||
* The MEGA SDK 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. | ||
* | ||
* @copyright Simplified (2-clause) BSD License. | ||
* | ||
* You should have received a copy of the license along with this | ||
* program. | ||
*/ | ||
#import "MEGABanner.h" | ||
#import "megaapi.h" | ||
|
||
using namespace mega; | ||
|
||
@interface MEGABanner () | ||
|
||
@property MegaBanner *megaBanner; | ||
@property BOOL cMemoryOwn; | ||
|
||
@end | ||
|
||
@implementation MEGABanner | ||
|
||
- (instancetype)initWithMegaBanner:(MegaBanner *)megaBanner cMemoryOwn:(BOOL)cMemoryOwn { | ||
self = [super init]; | ||
|
||
if (self != nil) { | ||
_megaBanner = megaBanner; | ||
_cMemoryOwn = cMemoryOwn; | ||
} | ||
|
||
return self; | ||
} | ||
|
||
- (void)dealloc { | ||
if (self.cMemoryOwn) { | ||
delete _megaBanner; | ||
} | ||
} | ||
|
||
- (instancetype)clone { | ||
return self.megaBanner ? [[MEGABanner alloc] initWithMegaBanner:self.megaBanner->copy() cMemoryOwn:YES] : nil; | ||
} | ||
|
||
- (MegaBanner *)getCPtr { | ||
return self.megaBanner; | ||
} | ||
|
||
- (NSString *)title{ | ||
if (!self.megaBanner) return nil; | ||
|
||
return self.megaBanner->getTitle() ? @(self.megaBanner->getTitle()) : nil; | ||
} | ||
|
||
- (NSString *)description { | ||
if (!self.megaBanner) return nil; | ||
|
||
return self.megaBanner->getDescription() ? @(self.megaBanner->getDescription()) : nil; | ||
} | ||
|
||
- (NSString *)imageFilename { | ||
if (!self.megaBanner) return nil; | ||
|
||
return self.megaBanner->getImage() ? @(self.megaBanner->getImage()) : nil; | ||
} | ||
|
||
- (NSString *)backgroundImageFilename { | ||
if (!self.megaBanner) return nil; | ||
|
||
return self.megaBanner->getBackgroundImage() ? @(self.megaBanner->getBackgroundImage()) : nil; | ||
} | ||
|
||
|
||
- (NSString *)imageLocationURLString { | ||
if (!self.megaBanner) return nil; | ||
|
||
return self.megaBanner->getImageLocation() ? @(self.megaBanner->getImageLocation()) : nil; | ||
} | ||
|
||
- (NSString *)URLString { | ||
if (!self.megaBanner) return nil; | ||
|
||
return self.megaBanner->getUrl() ? @(self.megaBanner->getUrl()) : nil; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/** | ||
* @file MEGABannerList.h | ||
* @brief List of MEGABanner | ||
* | ||
* (c) 2017- by Mega Limited, Auckland, New Zealand | ||
* | ||
* This file is part of the MEGA SDK - Client Access Engine. | ||
* | ||
* Applications using the MEGA API must present a valid application key | ||
* and comply with the the rules set forth in the Terms of Service. | ||
* | ||
* The MEGA SDK 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. | ||
* | ||
* @copyright Simplified (2-clause) BSD License. | ||
* | ||
* You should have received a copy of the license along with this | ||
* program. | ||
*/ | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "MEGABanner.h" | ||
|
||
/** | ||
* @brief List of MEGABanner objects | ||
* | ||
* A MEGABannerList has the ownership of the MEGABanner objects that it contains, so they will be | ||
* only valid until the MEGABannerList is deleted. | ||
* | ||
*/ | ||
@interface MEGABannerList : NSObject | ||
|
||
/** | ||
* @brief The number of banners in the list | ||
*/ | ||
@property (nonatomic, readonly) NSInteger size; | ||
|
||
- (nonnull instancetype)clone; | ||
|
||
/** | ||
* @brief Returns the MEGABanner at position i in the MEGABannerList | ||
* | ||
* The MEGABannerList retains the ownership of the returned MEGABanner. It will be only valid until | ||
* the MEGABannerList is deleted. | ||
* | ||
* If the index is >= the size of the list, this function returns NULL. | ||
* | ||
* @param i Position of the MEGABanner that we want to get for the list | ||
* @return MEGABanner at position i in the list | ||
*/ | ||
- (nullable MEGABanner *)bannerAtIndex:(NSInteger)index; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/** | ||
* @file MEGABannerList.mm | ||
* @brief List of MEGABanner objects | ||
* | ||
* (c) 2018-Present by Mega Limited, Auckland, New Zealand | ||
* | ||
* This file is part of the MEGA SDK - Client Access Engine. | ||
* | ||
* Applications using the MEGA API must present a valid application key | ||
* and comply with the the rules set forth in the Terms of Service. | ||
* | ||
* The MEGA SDK 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. | ||
* | ||
* @copyright Simplified (2-clause) BSD License. | ||
* | ||
* You should have received a copy of the license along with this | ||
* program. | ||
*/ | ||
#import "megaapi.h" | ||
#import "MEGABanner.h" | ||
#import "MEGABanner+init.h" | ||
#import "MEGABannerList.h" | ||
|
||
using namespace mega; | ||
|
||
@interface MEGABannerList () | ||
|
||
@property MegaBannerList *megaBannerList; | ||
@property BOOL cMemoryOwn; | ||
|
||
@end | ||
|
||
@implementation MEGABannerList | ||
|
||
- (instancetype)initWithMegaBannerList:(MegaBannerList *)megaBannerList cMemoryOwn:(BOOL)cMemoryOwn { | ||
self = [super init]; | ||
|
||
if (self) { | ||
_megaBannerList = megaBannerList; | ||
_cMemoryOwn = cMemoryOwn; | ||
} | ||
|
||
return self; | ||
} | ||
|
||
- (void)dealloc { | ||
if (self.cMemoryOwn) { | ||
delete _megaBannerList; | ||
} | ||
} | ||
|
||
- (instancetype)clone { | ||
return self.megaBannerList ? [[MEGABannerList alloc] initWithMegaBannerList:self.megaBannerList->copy() cMemoryOwn:YES] : nil; | ||
} | ||
|
||
- (MEGABanner *)bannerAtIndex:(NSInteger)index { | ||
return self.megaBannerList ? | ||
[[MEGABanner alloc] initWithMegaBanner:self.megaBannerList->get((int)index)->copy() cMemoryOwn:YES] : nil; | ||
} | ||
|
||
- (NSInteger)size { | ||
return self.megaBannerList ? self.megaBannerList->size() : 0; | ||
} | ||
|
||
@end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.