## ephy-permission-manager

ephy-permission-manager —

## Synopsis

    #define     EPHY_PERMISSION_MANAGER_IFACE   (k)
    #define     EPHY_IS_PERMISSION_MANAGER_IFACE(k)
    #define     EPHY_TYPE_PERMISSION_INFO
    enum        EphyPermissionType;
    enum        EphyPermission;
    EphyPermissionInfo* ephy_permission_info_new
                                                (const char *host,
                                                 EphyPermissionType type,
                                                 EphyPermission permission);
    EphyPermissionInfo* ephy_permission_info_copy
                                                (const EphyPermissionInfo *info);
    void        ephy_permission_info_free       (EphyPermissionInfo *info);
    GType       ephy_permission_manager_get_type
                                                (void);
    void        ephy_permission_manager_add     (EphyPermissionManager *manager,
                                                 const char *host,
                                                 EphyPermissionType type,
                                                 EphyPermission permission);
    void        ephy_permission_manager_remove  (EphyPermissionManager *manager,
                                                 const char *host,
                                                 EphyPermissionType type);
    void        ephy_permission_manager_clear   (EphyPermissionManager *manager);
    EphyPermission ephy_permission_manager_test (EphyPermissionManager *manager,
                                                 const char *host,
                                                 EphyPermissionType type);
    GList*      ephy_permission_manager_list    (EphyPermissionManager *manager,
                                                 EphyPermissionType type);

## Description

## Details

### EPHY_PERMISSION_MANAGER_IFACE()

    #define EPHY_PERMISSION_MANAGER_IFACE(k)	(G_TYPE_CHECK_CLASS_CAST((k), EPHY_TYPE_PERMISSION_MANAGER, EphyPermissionManagerIface))

`k` : |

### EPHY_IS_PERMISSION_MANAGER_IFACE()

    #define EPHY_IS_PERMISSION_MANAGER_IFACE(k)	(G_TYPE_CHECK_CLASS_TYPE ((k), EPHY_TYPE_PERMISSION_MANAGER))

`k` : |

### EPHY_TYPE_PERMISSION_INFO

    #define EPHY_TYPE_PERMISSION_INFO		(ephy_permission_info_get_type ())

### enum EphyPermissionType

    typedef enum
    {
    	EPT_COOKIE,
    	EPT_IMAGE,
    	EPT_POPUP
    } EphyPermissionType;

### enum EphyPermission

    typedef enum
    {
    	EPHY_PERMISSION_ALLOWED,
    	EPHY_PERMISSION_DENIED,
    	EPHY_PERMISSION_DEFAULT
    } EphyPermission;

### ephy_permission_info_new ()

    EphyPermissionInfo* ephy_permission_info_new
                                                (const char *host,
                                                 EphyPermissionType type,
                                                 EphyPermission permission);

`host` : | a host name
`type` : | a EphyPermissionType
`permission` : |
Returns : | the new EphyPermissionInfo

### ephy_permission_info_copy ()

    EphyPermissionInfo* ephy_permission_info_copy
                                                (const EphyPermissionInfo *info);

`info` : | a EphyPermissionInfo
Returns : | a copy of `info`

### ephy_permission_info_free ()

    void        ephy_permission_info_free       (EphyPermissionInfo *info);

Frees `info`.

`info` : | a EphyPermissionInfo

### ephy_permission_manager_get_type ()

    GType       ephy_permission_manager_get_type
                                                (void);

Returns : |

### ephy_permission_manager_add ()

    void        ephy_permission_manager_add     (EphyPermissionManager *manager,
                                                 const char *host,
                                                 EphyPermissionType type,
                                                 EphyPermission permission);

Adds the permission `allow` of type `type` for host `host` to the permissions database.

`manager` : | the EphyPermissionManager
`host` : | a host name
`type` : | a EphyPermissionType
`permission` : | either EPHY_PERMISSION_ALLOWED or EPHY_PERMISSION_DENIED

### ephy_permission_manager_remove ()

    void        ephy_permission_manager_remove  (EphyPermissionManager *manager,
                                                 const char *host,
                                                 EphyPermissionType type);

Removes the permission of type `type` for host `host` from the permissions database.

`manager` : | the EphyPermissionManager
`host` : | a host name
`type` : | a EphyPermissionType

### ephy_permission_manager_clear ()

    void        ephy_permission_manager_clear   (EphyPermissionManager *manager);

Clears the permissions database.

`manager` : | the EphyPermissionManager

### ephy_permission_manager_test ()

    EphyPermission ephy_permission_manager_test (EphyPermissionManager *manager,
                                                 const char *host,
                                                 EphyPermissionType type);

Gets the permission of `host` for type `type`. If there is no entry for this type for `host`, it will return EPHY_PERMISSION_DEFAULT.

`manager` : | the EphyPermissionManager
`host` : | a host name
`type` : | a EphyPermissionType
Returns : | the permission of type EphyPermission

### ephy_permission_manager_list ()

    GList*      ephy_permission_manager_list    (EphyPermissionManager *manager,
                                                 EphyPermissionType type);

Lists all permission entries of type `type` in the permissions database, each as its own EphyPermissionInfo

`manager` : | the EphyPermissionManager
`type` : | a EphyPermissionType
Returns : | the list of permission entries