File indexing completed on 2024-07-21 03:46:02

0001 /*
0002     This file is part of the syndication library
0003     SPDX-FileCopyrightText: 2006 Frank Osterfeld <osterfeld@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #ifndef SYNDICATION_RDF_TEXTINPUT_H
0009 #define SYNDICATION_RDF_TEXTINPUT_H
0010 
0011 #include <QString>
0012 #include <syndication/rdf/resourcewrapper.h>
0013 
0014 namespace Syndication
0015 {
0016 namespace RDF
0017 {
0018 /**
0019  * "The textinput element affords a method for submitting form data to an
0020  * arbitrary URL - usually located at the parent website.
0021  * The field is typically used as a search box or subscription form"
0022  *
0023  * @author Frank Osterfeld
0024  */
0025 class TextInput : public ResourceWrapper
0026 {
0027 public:
0028     /**
0029      * creates an object wrapping a null resource.
0030      * isNull() is @p true.
0031      */
0032     TextInput();
0033 
0034     /**
0035      * creates a text input object wrapping a rss:textinput resource
0036      *
0037      * @param resource resource to wrap, must be of type
0038      * rss:textinput, otherwise this object will not return
0039      * useful information.
0040      */
0041     explicit TextInput(ResourcePtr resource);
0042 
0043     /**
0044      * destructor
0045      */
0046     ~TextInput() override;
0047 
0048     /**
0049      * A descriptive title for the textinput field. For example: "Subscribe"
0050      * or "Search!"
0051      *
0052      * @return title of the text input, or a null string if not specified
0053      */
0054     QString title() const;
0055 
0056     /**
0057      * A brief description of the textinput field's purpose. For example:
0058      * "Subscribe to our newsletter for..." or "Search our site's archive
0059      * of..."
0060      *
0061      *
0062      * @return description TODO: specify format (HTML/plain text), or
0063      * a null string if not specified.
0064      */
0065     QString description() const;
0066 
0067     /**
0068      * The URL to which a textinput submission will be directed (using GET).
0069      *
0070      * @return URL, or a null string if not specified
0071      */
0072     QString link() const;
0073 
0074     /**
0075      * The text input field's (variable) name.
0076      *
0077      * @return name, or a null string if not specified
0078      */
0079     QString name() const;
0080 
0081     /**
0082      * Returns a description of the text input for debugging purposes.
0083      *
0084      * @return debug string
0085      */
0086     QString debugInfo() const;
0087 };
0088 
0089 } // namespace RDF
0090 } // namespace Syndication
0091 
0092 #endif //  SYNDICATION_RDF_TEXTINPUT_H