import cyrus-sasl-2.1.23
[cyrus-sasl.git] / mac / CommonKClient / mac_kclient3 / Headers / TicketKeeper / TicketKeeper.h
1 /* $Copyright:\r *\r * Copyright 1998-2000 by the Massachusetts Institute of Technology.\r * \r * All rights reserved.\r * \r * Export of this software from the United States of America may require a\r * specific license from the United States Government.  It is the\r * responsibility of any person or organization contemplating export to\r * obtain such a license before exporting.\r * \r * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and distribute\r * this software and its documentation for any purpose and without fee is\r * hereby granted, provided that the above copyright notice appear in all\r * copies and that both that copyright notice and this permission notice\r * appear in supporting documentation, and that the name of M.I.T. not be\r * used in advertising or publicity pertaining to distribution of the\r * software without specific, written prior permission.  Furthermore if you\r * modify this software you must label your software as modified software\r * and not distribute it in such a fashion that it might be confused with\r * the original MIT software. M.I.T. makes no representations about the\r * suitability of this software for any purpose.  It is provided "as is"\r * without express or implied warranty.\r * \r * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED\r * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF\r * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.\r * \r * Individual source code files are copyright MIT, Cygnus Support,\r * OpenVision, Oracle, Sun Soft, FundsXpress, and others.\r * \r * Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira,\r * and Zephyr are trademarks of the Massachusetts Institute of Technology\r * (MIT).  No commercial use of these trademarks may be made without prior\r * written permission of MIT.\r * \r * "Commercial use" means use of a name in a product or other for-profit\r * manner.  It does NOT prevent a commercial firm from referring to the MIT\r * trademarks in order to convey information (although in doing so,\r * recognition of their trademark status should be given).\r * $\r */\r\r/* $Header: /afs/andrew/system/cvs/src/sasl/mac/CommonKClient/mac_kclient3/Headers/TicketKeeper/TicketKeeper.h,v 1.2 2001/12/04 02:05:58 rjs3 Exp $ */\r\r#pragma once\r\r#include <Types.h>\r#include <Files.h>\r#include <Processes.h>\r#include <ConditionalMacros.h>\r\r#ifdef __cplusplus\rextern "C" {\r#endif\r\r#if PRAGMA_IMPORT\r#pragma import on\r#endif\r\r/*\r * TKAE_SendQuitApplication\r *\r * Send quit event to ticket keeper. This will cause Ticket Keeper to remove its\r * notification if it's up\r */\r\rOSStatus\rTKAE_SendQuitApplication ();\r\r/*\r * TKAE_SendOpenApplication\r *\r * Send open event to ticket keeper. Thiw will launch ticket keeper, and it will\r * display its self-dismissing notification if there's a problem\r */\r \rOSStatus\rTKAE_SendOpenApplication ();\r\r/*\r * TKAE_SendOpenApplicationNoNotification\r *\r * Send open event to Ticket Keeper. This will launch Ticket Keeper, and it will not\r * display its notification if there's a problem. It will stay running.\r */\r \rOSStatus\rTKAE_SendOpenApplicationNoNotification ();\r\r/*\r * TKAE_SendOpenApplicationNoNotificationFSSpec\r *\r * Send open event to the copy of Ticket Keeper specified in inTKFileSpec.\r * This will launch Ticket Keeper, and it will not\r * display its notification if there's a problem. It will stay running.\r */\r \rOSStatus\rTKAE_SendOpenApplicationNoNotificationFSSpec (FSSpec *inTKFileSpec);\r\r/*\r * TKAE_SendGetStatus\r *\r * Get status from Ticket Keeper\r */\r\rOSStatus\rTKAE_SendGetStatus (\r      OSErr*  outStatus);\r    \r/*\r * IsTicketKeeperRunning\r *\r * Return true if TK is running, and fills out outPSN if the pointer is non-null.\r * Return false if TK is not running, and outPSN is unchanged.\r *\r */\r        \rBoolean\rIsTicketKeeperRunning (ProcessSerialNumber *outPSN);\r\r/*\r   FindTicketKeeperInExtensions()\r   \r   Searches the startup volume for copies of Ticket Keeper and checks to see if\r   any of them are in the Extensions Folder.  If it finds one, returns true and\r   fills out *tkSpec.  If it doesn't find one or an error occurs, returns false\r   and *tkSpec is unchanged.\r   \r   If the hard drive catalog changes during the search, continues anyway.\r   \r   Uses functions from MoreFiles.\r*/\r\rBoolean\rFindTicketKeeperInExtensions(FSSpec *tkSpec);\r\r/*\r   TKAE_FindTargetTicketKeeper()\r   \r   Searches the startup volume to find the Ticket Keeper that would receive\r   AppleEvents if any of the TicketKeeperLib functions that send AEs were called.\r   First checks to see if TK is running, and returns the FSSpec of that one if it is.\r   Next looks in the Extensions Folder.  Finally it searches the drive for\r   a copy.\r   \r   If a Ticket Keeper is found, returns true and fills out *tkSpec. \r   If it doesn't find one or an error occurs, returns false and *tkSpec is unchanged.\r   \r   If the hard drive catalog changes during the search, continues anyway.\r*/\r\rBoolean TKAE_FindTargetTicketKeeper(FSSpec *tkSpec);\r\r#if !TARGET_API_MAC_CARBON\r\r/*\r    Menu State functions\r   \r       Ticket Keeper provides information needed for menus presented by the\r   Kerberos Control Strip and Kerberos Menu. \r */\r\rstruct MenuStateHeader;\rtypedef struct MenuStateHeader MenuStateHeader;\rtypedef MenuStateHeader**       MenuState;\r\r/*\r TKMS_GetMenuState\r      \r       Returns the current menu state. Dispose with TKMS_DisposeMenuState\r*/\r\rOSErr TKMS_GetMenuState (MenuState* outMenuState);\r\r/*\r  TKMS_DisposeMenuState\r  \r       Disposes the menu state.\r*/\r\rvoid TKMS_DisposeMenuState (MenuState outMenuState);\r\r/*\r  TKMS_GetDefaultCacheExpiration\r \r       Pass in the menu state returned by TKMS_GetMenuState\r   Returns the expiration time of the default cache, in Mac epoch\r*/\r      \rOSErr TKMS_GetDefaultCacheExpiration (MenuState inState, UInt32* outExpiration);\r\r/*\r  TKMS_GetDefaultCacheLastChangeTime\r     \r       Pass in the menu state returned by TKMS_GetMenuState\r   Returns the last change time of the default cache, in Mac epoch\r*/\r     \rOSErr TKMS_GetDefaultCacheLastChangeTime (MenuState inState, UInt32* outChangeTime);\r\r/*\r      TKMS_GetDefaultCachePrincipal\r  \r       Pass in the menu state returned by TKMS_GetMenuState\r   Returns the principal of the default cache, realm removed if necessary\r*/\r      \rOSErr TKMS_GetDefaultCachePrincipal (MenuState inState, Str255 outPrincipal);\r\r/*\r     TKMS_GetDefaultCacheDisplayPrincipal\r   \r       Pass in the menu state returned by TKMS_GetMenuState\r   Returns the principal of the default cache, quoting removed\r*/\r \rOSErr TKMS_GetDefaultCacheDisplayPrincipal (MenuState inState, Str255 outPrincipal);\r\r/*\r      TKMS_GetDefaultCacheShortDisplayPrincipal\r      \r       Pass in the menu state returned by TKMS_GetMenuState\r   Returns the principal of the default cache, quoting and default realm removed\r*/\r       \rOSErr TKMS_GetDefaultCacheShortDisplayPrincipal (MenuState inState, Str255 outPrincipal);\r\r/*\r TKMS_GetDefaultCacheHasValidTickets\r    \r       Pass in the menu state returned by TKMS_GetMenuState\r   Returns whether the default cache has valid tickets\r*/\r \rOSErr TKMS_GetDefaultCacheHasValidTickets (MenuState inState, Boolean* outValidTickets);\r\r/*\r  TKMS_GetNumberOfCaches\r \r       Pass in the menu state returned by TKMS_GetMenuState\r   Returns the total number of caches in the list\r*/\r      \rOSErr TKMS_GetNumberOfCaches (MenuState inState, UInt32* outNumCaches);\r\r/*\r   TKMS_SortCachesAlphabetically\r  \r       Pass in the menu state returned by TKMS_GetMenuState\r   Sorts the caches in the list alphabetically by principal\r*/\r    \rOSErr TKMS_SortCachesAlphabetically (\r MenuState       inState);\r\r/*\r  TKMS_GetCacheListChangeTime\r    \r       Pass in the menu state returned by TKMS_GetMenuState\r   Returns the last change time of the cache list in Mac epoch\r*/\r \rOSErr TKMS_GetCacheListLastChangeTime (MenuState inState, UInt32* outChangeTime);\r\r/*\r TKMS_GetIndexedCachePrincipal\r  \r       Pass in the menu state returned by TKMS_GetMenuState\r   Pass in index (zero based, less than value returned from TKMS_GetCachePrincipalForIndex)\r       Returns the cache principal of the cache at the index\r*/\r       \rOSErr TKMS_GetIndexedCachePrincipal (MenuState inState, UInt32 inIndex, Str255 outPrincipal);\r\r/*\r     TKMS_GetIndexedCacheDisplayPrincipal\r   \r       Pass in the menu state returned by TKMS_GetMenuState\r   Pass in index (zero based, less than value returned from TKMS_GetCachePrincipalForIndex)\r       Returns the cache principal of the cache at the index, quoting removed\r*/\r      \rOSErr TKMS_GetIndexedCacheDisplayPrincipal (MenuState inState, UInt32 inIndex, Str255 outPrincipal);\r\r/*\r      TKMS_GetIndexedCacheShortDisplayPrincipal\r      \r       Pass in the menu state returned by TKMS_GetMenuState\r   Pass in index (zero based, less than value returned from TKMS_GetCachePrincipalForIndex)\r       Returns the cache principal of the cache at the index, quoting and default realm removed\r*/\r    \rOSErr TKMS_GetIndexedCacheShortDisplayPrincipal (MenuState inState, UInt32 inIndex, Str255 outPrincipal);\r\r/*\r TKMS_GetIndexedCacheVersion\r    \r       Pass in the menu state returned by TKMS_GetMenuState\r   Pass in index (zero based, less than value returned from TKMS_GetCachePrincipalForIndex)\r       Returns the cache version of the cache at the index (version constants same as ccahe and login lib\r*/\r  \rOSErr TKMS_GetIndexedCacheVersion (MenuState inState, UInt32 inIndex, UInt32* outVersion);\r\r/*\r        TKMS_GetIndexedCacheIsDefault\r  \r       Pass in the menu state returned by TKMS_GetMenuState\r   Pass in index (zero based, less than value returned from TKMS_GetCachePrincipalForIndex)\r       Returns whether the cache at the index is default\r*/\r   \rOSErr TKMS_GetIndexedCacheIsDefault (MenuState inState, UInt32 inIndex, Boolean* outIsDefault);\r\r/*\r   TKMS_GetIndexedCacheIsValid\r    \r       Pass in the menu state returned by TKMS_GetMenuState\r   Pass in index (zero based, less than value returned from TKMS_GetCachePrincipalForIndex)\r       Returns whether the cache at the index has valid tickets\r*/\r    \rOSErr TKMS_GetIndexedCacheIsValid (MenuState inState, UInt32 inIndex, Boolean* outIsValid);\r\r/*\r       TKMS_GetIndexedCacheStartTime\r  \r       Pass in the menu state returned by TKMS_GetMenuState\r   Pass in index (zero based, less than value returned from TKMS_GetCachePrincipalForIndex)\r       Returns the start time of the cache at the index in Mac epoch\r*/\r       \rOSErr TKMS_GetIndexedCacheStartTime (MenuState inState, UInt32 inIndex, UInt32* outStartTime);\r\r/*\r    TKMS_GetIndexedCacheExpirationTime\r     \r       Pass in the menu state returned by TKMS_GetMenuState\r   Pass in index (zero based, less than value returned from TKMS_GetCachePrincipalForIndex)\r       Returns the expiration time of the cache at the index in Mac epoch\r*/\r  \rOSErr TKMS_GetIndexedCacheExpirationTime (MenuState inState, UInt32 inIndex, UInt32* outExpirationTime);\r\r/*\r  TKMS_SetIndexedDefaultCache\r    \r       Pass in the menu state returned by TKMS_GetMenuState\r   Pass in index (zero based, less than value returned from TKMS_GetCachePrincipalForIndex)\r       Sets the cache at the index to be default\r*/\r   \rOSErr TKMS_SetIndexedDefaultCache (MenuState inState, UInt32 inIndex);\r\r/*\r    TKMS_DestroyIndexedCache\r       \r       Pass in the menu state returned by TKMS_GetMenuState\r   Pass in index (zero based, less than value returned from TKMS_GetCachePrincipalForIndex)\r       Destroys the cache\r*/\r  \rOSErr TKMS_DestroyIndexedCache (MenuState inState, UInt32 inIndex);\r\r/*\r       TKMS_RenewIndexedCache\r \r       Pass in the menu state returned by TKMS_GetMenuState\r   Pass in index (zero based, less than value returned from TKMS_GetCachePrincipalForIndex)\r       Renews the cache\r*/\r    \rOSErr TKMS_RenewIndexedCache (MenuState inState, UInt32 inIndex);\r\r\r/*\r        TKMS_ChangeIndexedCachePassword\r        \r       Pass in the menu state returned by TKMS_GetMenuState\r   Pass in index (zero based, less than value returned from TKMS_GetCachePrincipalForIndex)\r       Changes the password of the principal associated with the cache\r*/\r     \rOSErr TKMS_ChangeIndexedCachePassword (MenuState inState, UInt32 inIndex);\r\r/*\r        TKMS_GetFloaterStructureRegion\r \r       Pass in the menu state returned by TKMS_GetMenuState\r   Copies the structure region of the floater window into ioRegion. Used by tear-off MDEF.\r*/\r     \rOSErr TKMS_GetFloaterStructureRegion (\r        MenuState       inState,\r       RgnHandle       ioRegion);\r\r/*\r TKMS_DestroyDefaultCache\r\r      Destroys the default cache      \r*/\r    \rOSErr TKMS_DestroyDefaultCache (void);\r\r/*\r    TKMS_NewLogin\r\r Create a new cache, log in a new principal.\r*/\r \rOSErr TKMS_NewLogin (void);\r\r/*\r       TKMS_RenewDefaultCache\r\r        Renew tickets for the default cache\r*/\r \rOSErr TKMS_RenewDefaultCache (void);\r\r/*\r      TKMS_ChangeDefaultCachePassword\r\r       Changes the password of the principal associated with the default cache\r*/\r     \rOSErr TKMS_ChangeDefaultCachePassword (void);\r\r/*\r     TKMS_MoveFloaterStructureRegion\r        \r       Pass in the new bounding box for the structure region of the floater\r   Moves the floater to the new location\r*/\r       \rOSErr TKMS_MoveFloaterStructureRegion (\r       const Rect*     inNewBounds);\r\r/*\r      TKMS_OpenKerberosControlPanel\r  \r       Open the Kerberos Control Panel (if you can't calle KMLib because you're not\r   able to send events)\r*/\r        \rOSErr TKMS_OpenKerberosControlPanel (void);\r\r/*\r       TKF_SetHasCloseBox\r     \r       Set whether the floater has a close box or not\r*/\r      \rOSErr TKF_SetHasCloseBox (\r    Boolean         inHasCloseBox);\r\r/*\r    TKF_GetHasCloseBox\r     \r       return whether the floater has a close box or not\r*/\r   \rOSErr TKF_GetHasCloseBox (\r    Boolean*        outHasCloseBox);\r\r/*\r   TKF_SetDrawPies\r        \r       Set whether the floater draws pies for time remaining or not\r*/\r        \rOSErr TKF_SetDrawPies (\r       Boolean         inDrawPies);\r\r/*\r       TKF_GetDrawPies\r        \r       return whether the floater draws pies for time remaining or not\r*/\r     \rOSErr TKF_GetDrawPies (\r       Boolean*        outDrawPies);\r\r/*\r      TKF_SetIsVisible\r       \r       Set whether the floater is visible or not\r*/\r   \rOSErr TKF_SetIsVisible (\r      Boolean         inIsVisible);\r\r/*\r      TKF_GetIsVisible\r       \r       Return whether the floater is visible or not\r*/\r        \rOSErr TKF_GetIsVisible (\r      Boolean*        outIsVisible);\r\r/*\r     TKF_SetIsZoomedOut\r     \r       Set whether the floater is zoomed out or not\r*/\r        \rOSErr TKF_SetIsZoomedOut (\r    Boolean         inIsZoomedOut);\r\r/*\r    TKF_GetIsZoomedOut\r     \r       Return whether the floater is zoomed out or not\r*/\r     \rOSErr TKF_GetIsZoomedOut (\r    Boolean*        outIsZoomedOut);\r\r#endif /* !TARGET_API_MAC_CARBON */\r\r#ifdef PRAGMA_IMPORT_OFF\r#pragma import off\r#elif PRAGMA_IMPORT\r#pragma import reset\r#endif\r\r#ifdef __cplusplus\r}\r#endif\r\r/*\r * Constants\r */\r\renum {\r   keyDontQuit                             = FOUR_CHAR_CODE ('stay'),\r     keyStatus                               = FOUR_CHAR_CODE ('Stat')\r};\r\renum {\r   kTicketKeeperClass              = FOUR_CHAR_CODE ('TixK')\r};\r\renum {\r   kAEGetStatus                    = FOUR_CHAR_CODE ('Stat')\r};\r\renum {\r   kTicketKeeperSignature  = FOUR_CHAR_CODE ('TixK')\r};\r