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

#include <PiglerAPI.h>

Inheritance diagram for PiglerAPI:

Public Member Functions

 PiglerAPI ()
 
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 ()
 
TInt GetMaxNotificationsCount ()
 
TInt GetGlobalNotificationsCount ()
 
TInt StartAnnaServer ()
 
TInt GetBitmapSize ()
 
void Close ()
 
void SetTapHandler (IPiglerTapHandler *handler)
 

Detailed Description

Pigler Notifications API

Version
v4

Constructor & Destructor Documentation

◆ PiglerAPI()

PiglerAPI::PiglerAPI ( )

Copyright (c) 2023-2024 Arman Jussupgaliyev Copyright (c) 2023 Mathew (curoviyxru)

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

◆ GetBitmapSize()

TInt PiglerAPI::GetBitmapSize ( )

Returns bitmap dimension

Since
v4

◆ GetGlobalNotificationsCount()

TInt PiglerAPI::GetGlobalNotificationsCount ( )

Gets number of notifications created by all applications

Returns
Global notifications count or error code

Error codes:

KErrNotReady if connection was not initialized
KErrNotSupported

Since
v4

◆ 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

◆ GetMaxNotificationsCount()

TInt PiglerAPI::GetMaxNotificationsCount ( )

Gets maximum number of notifications that can be created by plugin

Returns
Max notifications count or error code

Error codes:

KErrNotReady if connection was not initialized
KErrNotSupported

Since
v4

◆ 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!
All notifications will be removed on connection close

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

Number of notifications that can be created is limited and depends on the platform

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
KErrOverflow if no notification slots left
KErrAlreadyExists if application exceeded maximum number of notifications per app

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, since v4 bitmap size is obtained by GetBitmapSize

◆ 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

◆ StartAnnaServer()

TInt PiglerAPI::StartAnnaServer ( )

Starts server on Anna and N97, required to call before initializing connection

Since
v4