PiglerAPI
Public Member Functions | List of all members
PiglerAPI Class Reference

#include <PiglerAPI.h>

Inheritance diagram for PiglerAPI:

Public Member Functions

TInt Init (TBuf< 64 > appName)
 
TInt Init ()
 
void SetAppId (TInt appId)
 
TInt GetAPIVersion ()
 
TBuf< 64 > GetAppName ()
 
TInt SetNotification (TInt uid, TBuf< 256 > text)
 
TInt RemoveNotification (TInt uid)
 
TInt RemoveAllNotifications ()
 
TInt GetLastTappedNotification ()
 
TInt SetRemoveOnTap (TInt uid, TBool remove)
 
TInt SetLaunchAppOnTap (TInt uid, TBool launchOnTap)
 
TInt SetNotificationIcon (TInt uid, TPtrC8 &iconBitmap)
 
TInt GetNotificationsCount ()
 
void Close ()
 
void SetTapHandler (IPiglerTapHandler *handler)
 

Detailed Description

Pigler Notifications API

Version
v3

Member Function Documentation

◆ Close()

void PiglerAPI::Close ( )

Closes API connection

◆ GetAPIVersion()

TInt PiglerAPI::GetAPIVersion ( )
Returns
API version of installed plugin or error code

Error codes:

KErrNotReady if connection was not initialized

Since
v2

◆ GetAppName()

TBuf< 64 > PiglerAPI::GetAppName ( )
Returns
Current app name

◆ GetLastTappedNotification()

TInt PiglerAPI::GetLastTappedNotification ( )

Gets last tapped notification

Returns
Notification UID or error code

Error codes:

KErrNotFound if app is not initialized
KErrNone if no notification has been tapped yet
KErrNotReady if connection was not initialized

◆ GetNotificationsCount()

TInt PiglerAPI::GetNotificationsCount ( )

Gets number of notifications created by this app

Returns
Notifications count or error code

Error codes:

KErrNotReady if connection was not initialized
KErrNotSupported

Since
v3

◆ Init() [1/2]

TInt PiglerAPI::Init ( )

Initializes API connection with random app name

Don't use if you need notification callbacks!

See also
PiglerAPI::Init(TBuf<64>)
Returns
Connection error, or notification UID if app was started by tap handle event, otherwise KErrNone is returned

◆ Init() [2/2]

TInt PiglerAPI::Init ( TBuf< 64 >  appName)

Initializes API connection with specified app name

Returns
Connection error, or notification UID if app was started by tap handle event, otherwise KErrNone is returned
Parameters
appNameApplication name

◆ RemoveAllNotifications()

TInt PiglerAPI::RemoveAllNotifications ( )

Removes all notifications created by this app

Returns
Removed items count or error code

Error codes:

KErrNotReady if connection was not initialized

◆ RemoveNotification()

TInt PiglerAPI::RemoveNotification ( TInt  uid)

Removes notification by its UID

Returns
Error code

Error codes:

KErrNotFound if there is no such item with that uid
KErrAccessDenied if item was created by another app
KErrNotReady if connection was not initialized

Parameters
uidNotification UID

◆ SetAppId()

void PiglerAPI::SetAppId ( TInt  appId)

Sets application ID that needs to be launched on notification tap, must be called before Init()

Parameters
appIdSymbian app UID

◆ SetLaunchAppOnTap()

TInt PiglerAPI::SetLaunchAppOnTap ( TInt  uid,
TBool  launchOnTap 
)

Marks that app needs to be launched on notification tap, by default this setting is true

Returns
Error code

Error codes:

KErrNotFound if there is no such item with that uid
KErrAccessDenied if item was created by another app
KErrNotReady if connection was not initialized

Parameters
uidNotification UID
launchOnTap
See also
PiglerAPI::SetAppId(TInt)
Since
v2

◆ SetNotification()

TInt PiglerAPI::SetNotification ( TInt  uid,
TBuf< 256 >  text 
)

Adds or updates notification

Returns
Notification UID or error code

Error codes:

KErrNotFound if there is no such item with that uid
KErrAccessDenied if item was created by another app
KErrNotReady if connection was not initialized

Parameters
uidNotification UID, 0 - to create
textNotification text

◆ SetNotificationIcon()

TInt PiglerAPI::SetNotificationIcon ( TInt  uid,
TPtrC8 &  iconBitmap 
)

Sets notification icon

Returns
Error code

Error codes:

KErrNotFound if there is no such item with that uid
KErrAccessDenied if item was created by another app
KErrUnderflow if icon or mask have the smaller size than 68x68
KErrNotReady if connection was not initialized

Parameters
uidNotification UID
iconBitmapIcon bitmap 68x68 in ARGB32 format

◆ SetRemoveOnTap()

TInt PiglerAPI::SetRemoveOnTap ( TInt  uid,
TBool  remove 
)

Marks that notification needs to be removed on tap, by default this setting is true

Returns
Error code

Error codes:

KErrNotFound if there is no such item with that uid
KErrAccessDenied if item was created by another app
KErrNotReady if connection was not initialized

Parameters
uidNotification UID
remove

◆ SetTapHandler()

void PiglerAPI::SetTapHandler ( IPiglerTapHandler handler)

Sets current tap handler

Parameters
handlerTap handler, ownership is not transferred