00001
00004
00005
00006
00007
00008 #ifndef _cel_credprovider_h_
00009 #define _cel_credprovider_h_
00010
00011
00012 #include "cel_referable.h"
00013 #include "cel_memory.h"
00014 #include "cel_string.h"
00015
00016 namespace Celartem
00017 {
00023 enum AuthTargetType
00024 {
00025 authGeneral = 0,
00026 authHttpBasic = 1,
00027 authHttpProxy = 2,
00028 authPixelSafe2Local = 3,
00029 authPixelSafe2 = 4,
00030 authPixelSafe3 = 5,
00031 };
00032
00042 class CredentialInfo : public Referable
00043 {
00044 public:
00050 virtual String getTarget() const = 0;
00051
00060 virtual String getUserName() const = 0;
00061
00070 virtual String getPassword() const = 0;
00071
00082 virtual void confirm(bool inCredentialIsConfirmed) = 0;
00083
00089 virtual bool isConfirmed() const = 0;
00090 };
00091
00103 class CredentialProvider : public Referable
00104 {
00105 public:
00110 enum GetCredentialFlag
00111 {
00112 gcfNoUserInteractionIfCan = 1,
00113 gcfPreviousCredentialIsInvalid = 2,
00114 };
00115
00150 virtual AutoPtr<CredentialInfo> getCredential(
00151 AuthTargetType inAuthTargetType,
00152 const String& inAuthTarget,
00153 u32 inFlags = 0) = 0;
00154
00187 static AutoPtr<CredentialProvider> createFromStrings(
00188 const String& inUserName,
00189 const String& inPassword,
00190 const String& inTarget = NullString);
00191
00217 static AutoPtr<CredentialProvider> create(
00218 void *inParentHandle,
00219 const String& inCaption,
00220 const String& inMessage = NullString,
00221 unsigned long inFlags = 0);
00222 };
00223
00224 }
00225
00226
00227 #endif // _cel_credprovider_h_