remotestoragefw/webdavaccessplugin/inc/rsfwdavdefs.h
branchRCL_3
changeset 19 88ee4cf65e19
parent 16 87c71b25c937
child 20 1aa8c82cb4cb
equal deleted inserted replaced
16:87c71b25c937 19:88ee4cf65e19
     1 /*
       
     2 * Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  WebDAV specific constant definitions
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef RSFWDAVDEFS_H
       
    20 #define RSFWDAVDEFS_H
       
    21 
       
    22 // CONSTANTS
       
    23 // max name for the server 
       
    24 const TInt KMaxServerNameLen           = 210;
       
    25 
       
    26 // max length for each connection parameter 
       
    27 // (username, password etc.)
       
    28 const TInt KMaxConnParameter           = 64;
       
    29 
       
    30 // Size of buffer used when submitting request bodies (PUT, PROPFIND...)
       
    31 const TInt KDefaultSubmitSize          = 14000; 
       
    32 
       
    33 // Size of buffer used when reading a reply to file (like GET)
       
    34 const TInt KDefaultFileBufferSize      = 81800;
       
    35 
       
    36 // maximum length for range, content-range
       
    37 // or timeout header values
       
    38 const TInt KMaxFieldValueLength         = 64;
       
    39 
       
    40 // length for the DAV version, which should be simply DAV: 1 or DAV: 1,2
       
    41 const TInt KMaxDavVersionValue          = 15;
       
    42 
       
    43 const TInt KDavResourceTypeCollection = 1;
       
    44 const TInt KDavResourceTypeOther      = 0;
       
    45 const TInt KDavVersionTwo              = 2;
       
    46 
       
    47 // expat XML-parser wants the data in the chunks of 2k
       
    48 // actually crashes otherwise...
       
    49 const TInt KSymbianXmlParserMaxData    = 2048;
       
    50 
       
    51 // overhead of UTF-8 encoding
       
    52 const TInt KEncodingOverhead = 2;
       
    53 
       
    54 // length of "http://"
       
    55 const TInt KProtocolPrefix   = 7;
       
    56 
       
    57 // when building "<target-url> (<target-token>)"
       
    58 const TInt KTaggedLockTokenOverhead = 7;
       
    59 
       
    60 // when building "<target-token>"
       
    61 const TInt KLockTokenOverhead = 2;
       
    62 
       
    63 _LIT8(KUserAgent,"S60 Remote Storage WebDav client");
       
    64 _LIT8(KAccept, "*/*");
       
    65 _LIT8(KTextXml, "text/xml");
       
    66 _LIT8(KTextPlain, "text/plain");
       
    67 _LIT8(KSecondDash, "Second-");
       
    68 
       
    69 _LIT8(KParenthAngleFormat, "(<%S>)");
       
    70 _LIT8(KTaggedParenthAngleFormat, "<%S> (<%S>)");
       
    71 _LIT(KDateFormat,"%D%M%Y%/0%1%/1%2%/2%3%/3 %:0%H%:1%T%:2%S.%C%:3");
       
    72 
       
    73 _LIT(KWebDavClientPanic, "WEBDAV-EC");
       
    74 
       
    75 _LIT8(KWebDavPropFind,  "PROPFIND");
       
    76 _LIT8(KWebDavMkCol,     "MKCOL");
       
    77 _LIT8(KWebDavDelete,    "DELETE");
       
    78 _LIT8(KWebDavCopy,      "COPY");
       
    79 _LIT8(KWebDavPut,       "PUT");
       
    80 _LIT8(KWebDavOptions,   "OPTIONS");
       
    81 _LIT8(KWebDavMove,      "MOVE");
       
    82 _LIT8(KWebDavLock,      "LOCK");
       
    83 _LIT8(KWebDavUnlock,    "UNLOCK");
       
    84 
       
    85 _LIT8(KWebDavDepth,     "Depth");
       
    86 _LIT8(KWebDavIf,        "If");
       
    87 _LIT8(KWebDavDest,      "Destination");
       
    88 _LIT8(KWedDavLockToken, "Lock-Token");
       
    89 _LIT8(KWebDavTimeout,   "Timeout");
       
    90 _LIT8(KWebDavOverwrite, "Overwrite");
       
    91 _LIT8(KWebDavOverwriteY,"T");
       
    92 _LIT8(KWebDavOverwriteN,"F");
       
    93 _LIT8(KWebDavNoProxy, "no-cache");
       
    94 _LIT8(KKeepAlive, "keep-alive");
       
    95 
       
    96 
       
    97 class RsfwDavStatus
       
    98 /** 
       
    99 Status code extensions to HTTP/1.1
       
   100 Defined in RFC 2518 (WebDAV)
       
   101 */
       
   102     {
       
   103 public:
       
   104     enum TRsfwDavStatus
       
   105         {
       
   106         /** 'Informational' range of codes 1xx */
       
   107         EProcessing                     = 102,
       
   108         /** 'Successful' range of codes 2xx */
       
   109         EMultiStatus                    = 207,
       
   110         /** 'Client Error' range of codes 4xx */
       
   111         EUnprocessableEntity            = 422,
       
   112         ELocked                         = 423,
       
   113         EFailedDependency               = 424, 
       
   114         /** 'Server Error' range of codes 5xx */
       
   115         EInsufficientStorage            = 507
       
   116         };
       
   117     };
       
   118 
       
   119 
       
   120 // DATA TYPES
       
   121 enum TWebDavClientPanics
       
   122     {
       
   123     EReqBodySumitBufferNotAllocated,
       
   124     KBodyWithInvalidSize,
       
   125     KCouldntNotifyBodyDataPart,
       
   126     KOutOfMemory
       
   127     };
       
   128 
       
   129 enum TWebDavOp
       
   130     {
       
   131     EWebDavOpNone,
       
   132     EWebDavOpOptions,      
       
   133     EWebDavOpGet,
       
   134     EWebDavOpPut,
       
   135     EWebDavOpDelete,
       
   136     EWebDavOpPropFindSingle,
       
   137     EWebDavOpPropFindMulti,
       
   138     EWebDavOpMkCol,
       
   139     EWebDavOpMove,
       
   140     EWebDavOpLock,
       
   141     EWebDavOpUnlock,
       
   142     EWebDavOpRefreshLock
       
   143     };
       
   144 
       
   145 
       
   146 #endif // RSFWDAVDEFS_H
       
   147 
       
   148 // End of File