Skip to content

Commit

Permalink
Code cleaning for Ads and Notification wrappers.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdan Iusco committed Nov 24, 2011
1 parent 30b315b commit d81f009
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 50 deletions.
28 changes: 19 additions & 9 deletions libs/Ads/Banner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ MA 02110-1301, USA.

/**
* @file Banner.cpp
* @author Bogdan Iusco
* @author Emma Tresanszki and Bogdan Iusco
* @date 1 Nov 2011
*
* \brief Provides a widget that displays advertisement to the user.
* @brief Provides a widget that displays advertisement to the user.
* When the user taps a banner, it triggers an action programmed into
* the advertisement.
* Your application is notified when an action starts or stops.
Expand All @@ -30,6 +31,8 @@ MA 02110-1301, USA.

#include <maapi.h>
#include <mastdlib.h>
#include <conprint.h>
#include <MAUtil/util.h>

#include "Banner.h"
#include "BannerListener.h"
Expand Down Expand Up @@ -125,7 +128,8 @@ namespace Ads
/**
* Set a widget integer property, in hexadecimal base.
* @param property A string representing which property to set.
* @param value The integer value in hexadecimal which will be assigned to the property.
* @param value The integer value in hexadecimal which will be assigned to
* the property.
* @return Any of the following result codes:
* - #MA_ADS_RES_OK if the property could be set.
* - #MA_ADS_RES_INVALID_PROPERTY_NAME if the property name was invalid.
Expand Down Expand Up @@ -301,9 +305,12 @@ namespace Ads

/**
* Sets the request state of the ads.
* If set to true ads are starting to be requested, if set to false the request for ads is stopped.
* Available only on Android. On iOS ads loading starts automatically at creation.
* @param requestState If true ads are starting to be requested, otherwise the request for ads is stopped.
* If set to true ads are starting to be requested, if set to false the
* request for ads is stopped.
* Available only on Android. On iOS ads loading starts automatically at
* creation.
* @param requestState If true ads are starting to be requested, otherwise
* the request for ads is stopped.
*/
void Banner::requestContent(bool requestState)
{
Expand All @@ -312,10 +319,12 @@ namespace Ads

/**
* Sets the devices that are going to receive test ads only.
* You should utilize this property during development to avoid generating false impressions.
* You should utilize this property during development to avoid generating
* false impressions.
* Causes test ads to be returned to a device.
* Available only on Android.
* @param testDevice the device ID. Use TEST_EMULATOR to get test ads in the emulator.
* @param testDevice the device ID. Use TEST_EMULATOR to get test ads in
* the emulator.
*/
void Banner::addTestDevice(const MAUtil::String& testDevice)
{
Expand Down Expand Up @@ -354,7 +363,8 @@ namespace Ads
}

/**
* Sets the coloration of test ads,specifically the gradient background color at top.
* Sets the coloration of test ads,specifically the gradient background
* color at top.
* Available only on Android.
* @param color A hexadecimal color value, e.g. 0xFF0000.
* @return Any of the following result codes:
Expand Down
34 changes: 19 additions & 15 deletions libs/Ads/Banner.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ MA 02110-1301, USA.

/**
* @file Banner.h
* @author Bogdan Iusco
* @author Emma Tresanszki and Bogdan Iusco
* @date 1 Nov 2011
*
* \brief Provides a widget that displays advertisement to the user.
* @brief Provides a widget that displays advertisement to the user.
* When the user taps a banner, it triggers an action programmed into
* the advertisement.
* Your application is notified when an action starts or stops.
Expand All @@ -31,13 +32,8 @@ MA 02110-1301, USA.
#ifndef ADS_BANNER_H_
#define ADS_BANNER_H_

#include <ma.h>
#include <conprint.h>
#include <MAUtil/String.h>
#include <MAUtil/Map.h>
#include <MAUtil/Vector.h>
#include <MAUtil/Environment.h>
#include <MAUtil/util.h>

namespace Ads
{
Expand Down Expand Up @@ -140,19 +136,25 @@ namespace Ads

/**
* Sets the request state of the ads.
* If set to true ads are starting to be requested, if set to false loading ads is stopped.
* Available only on Android. On iOS ads loading starts automatically at creation.
* Call requestContent(true) after the ad is created and/or after you set properties to it.
* @param requestState If true ads are starting to be requested, otherwise the request for ads is stopped.
* If set to true ads are starting to be requested, if set to false
* loading ads is stopped.
* Available only on Android. On iOS ads loading starts automatically at
* creation.
* Call requestContent(true) after the ad is created and/or after you
* set properties to it.
* @param requestState If true ads are starting to be requested,
* otherwise the request for ads is stopped.
*/
virtual void requestContent(bool requestState);

/**
* Sets the devices that are going to receive test ads only.
* You should utilize this property during development to avoid generating false impressions.
* You should utilize this property during development to avoid
* generating false impressions.
* Causes test ads to be returned to a device.
* Available only on Android.
* @param testDevice the device ID. Use TEST_EMULATOR to get test ads in the emulator.
* @param testDevice the device ID. Use TEST_EMULATOR to get test ads
* in the emulator.
*/
virtual void addTestDevice(const MAUtil::String& testDevice);

Expand All @@ -175,7 +177,8 @@ namespace Ads
virtual int setBackgroundColor(const int color);

/**
* Sets the coloration of test ads,specifically the gradient background color at top.
* Sets the coloration of test ads,specifically the gradient background
* color at top.
* Available only on Android.
* @param color A hexadecimal color value, e.g. 0xFF0000.
* @return Any of the following result codes:
Expand Down Expand Up @@ -279,7 +282,8 @@ namespace Ads
/**
* Set a widget integer property, in hexadecimal base.
* @param property A string representing which property to set.
* @param value The integer value in hexadecimal which will be assigned to the property.
* @param value The integer value in hexadecimal which will be assigned
* to the property.
* @return Any of the following result codes:
* - #MAW_RES_OK if the property could be set.
* - #MAW_RES_INVALID_HANDLE if the handle was invalid.
Expand Down
5 changes: 3 additions & 2 deletions libs/Ads/BannerListener.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ MA 02110-1301, USA.
/**
* @file BannerListener.h
* @author Bogdan Iusco
* @date 1 Nov 2011
*
* \brief Listener for banner events.
* @brief Listener for banner events.
*/

#ifndef ADS_BANNER_LISTENER_H_
Expand All @@ -32,7 +33,7 @@ namespace Ads
class Banner;

/**
* \brief Listener for banner events.
* @brief Listener for banner events.
*/
class BannerListener
{
Expand Down
7 changes: 4 additions & 3 deletions libs/Ads/BannerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ MA 02110-1301, USA.
*/

/**
* @file BannerManager.cpp
* @author Bogdan Iusco
* @file BannerManager.h
* @author Emma Tresanszki and Bogdan Iusco
* @date 1 Nov 2011
*
* \brief The BannnerManager manages banner events and dispatches
* @brief The BannnerManager manages banner events and dispatches
* them to the target banners.
*/

Expand Down
10 changes: 4 additions & 6 deletions libs/Ads/BannerManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,16 @@ MA 02110-1301, USA.

/**
* @file BannerManager.h
* @author Bogdan Iusco
* @author Emma Tresanszki and Bogdan Iusco
* @date 1 Nov 2011
*
* \brief The BannnerManager manages banner events and dispatches
* @brief The BannnerManager manages banner events and dispatches
* them to the target banners.
*/

#ifndef ADS_BANNER_MANAGER_H_
#define ADS_BANNER_MANAGER_H_

#include <ma.h>

#include <MAUtil/String.h>
#include <MAUtil/Map.h>
#include <MAUtil/Environment.h>
Expand All @@ -40,7 +39,7 @@ namespace Ads
class Banner;

/**
* \brief Class that handles banner events.
* @brief Class that handles banner events.
*/
class BannerManager : public MAUtil::CustomEventListener
{
Expand Down Expand Up @@ -105,5 +104,4 @@ namespace Ads

} // namespace Ads


#endif /* ADS_BANNER_MANAGER_H_ */
12 changes: 8 additions & 4 deletions libs/Notification/LocalNotification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ MA 02110-1301, USA.

#include <maapi.h>
#include <mastdlib.h>
#include <conprint.h>
#include <matime.h>
#include <MAUtil/util.h>

#include "LocalNotification.h"

Expand Down Expand Up @@ -446,14 +449,15 @@ namespace Notification

/**
* Define your own color and pattern for the lights.
* Not every color in the spectrum is supported by the device LEDs, and not every
* device supports the same colors, so the hardware estimates to the best of its
* ability. Green is the most common notification color.
* Not every color in the spectrum is supported by the device LEDs, and not
* every device supports the same colors, so the hardware estimates to the
* best of its ability. Green is the most common notification color.
* Also, not all Android devices support this feature.
* Platform: Android.
* @param lightPattern a NotificationFlashLights struct.
*/
void LocalNotification::setFlashLightsPattern(const NotificationFlashLights lightPattern)
void LocalNotification::setFlashLightsPattern(
const NotificationFlashLights lightPattern)
{
MAUtil::String pattern = "";
pattern = MAUtil::integerToString(lightPattern.ledARGB) + ",";
Expand Down
7 changes: 0 additions & 7 deletions libs/Notification/LocalNotification.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,7 @@ MA 02110-1301, USA.
#ifndef NOTIFICATION_LOCAL_NOTIFICATION_H_
#define NOTIFICATION_LOCAL_NOTIFICATION_H_

#include <ma.h>
#include <conprint.h>
#include <matime.h>
#include <MAUtil/String.h>
#include <MAUtil/Map.h>
#include <MAUtil/Vector.h>
#include <MAUtil/Environment.h>
#include <MAUtil/util.h>

namespace Notification
{
Expand Down
5 changes: 4 additions & 1 deletion libs/Notification/NotificationManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ MA 02110-1301, USA.
// Default buffer size.
#define BUFFER_SIZE 256

#include <conprint.h>

#include "NotificationManager.h"
#include "LocalNotification.h"
#include "LocalNotificationListener.h"
Expand Down Expand Up @@ -375,7 +377,8 @@ namespace Notification
* @param ticker The text that flows by in the status bar when the
* notification first activates.
*/
void NotificationManager::setPushNotificationsTickerText(const MAUtil::String& ticker)
void NotificationManager::setPushNotificationsTickerText(
const MAUtil::String& ticker)
{
maNotificationPushSetTickerText(ticker.c_str());
}
Expand Down
2 changes: 0 additions & 2 deletions libs/Notification/NotificationManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ MA 02110-1301, USA.
#ifndef NOTIFICATION_NOTIFICATION_MANAGER_H_
#define NOTIFICATION_NOTIFICATION_MANAGER_H_

#include <ma.h>

#include <MAUtil/String.h>
#include <MAUtil/Map.h>
#include <MAUtil/Environment.h>
Expand Down
2 changes: 2 additions & 0 deletions libs/Notification/PushNotification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ MA 02110-1301, USA.

#define DEFAULT_APP_ICON_BADGE_NUMBER -1

#include <conprint.h>

#include "PushNotification.h"

namespace Notification
Expand Down
1 change: 0 additions & 1 deletion libs/Notification/PushNotification.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ MA 02110-1301, USA.
#ifndef NOTIFICATION_PUSH_NOTIFICATION_H_
#define NOTIFICATION_PUSH_NOTIFICATION_H_

#include <conprint.h>
#include <MAUtil/String.h>

namespace Notification
Expand Down

0 comments on commit d81f009

Please sign in to comment.