#ifndef SEEN_SP_URI_REFERENCES_H
#define SEEN_SP_URI_REFERENCES_H
/*
* Helper methods for resolving URI References
*
* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* Abhishek Sharma
*
* Copyright (C) 2001-2002 Lauris Kaplinski
* Copyright (C) 2001 Ximian, Inc.
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <cstddef>
#include <vector>
#include <set>
#include <sigc++/connection.h>
#include "bad-uri-exception.h"
#include "sp-object.h"
#include "sp-item.h"
#include "sp-use.h"
/**
* A class encapsulating a reference to a particular URI; observers can
* be notified when the URI comes to reference a different SPObject.
*
* The URIReference increments and decrements the SPObject's hrefcount
* automatically.
*
* @see SPObject
* @see sp_object_href
* @see sp_object_hunref
*/
/**
* Constructor.
*
* @param owner The object on whose behalf this URIReference
* is holding a reference to the target object.
*/
/**
* Destructor. Calls shutdown() if the reference has not been
* shut down yet.
*/
virtual ~URIReference();
/**
* Attaches to a URI, relative to the specified document.
*
* Throws a BadURIException if the URI is unsupported,
* or the fragment identifier is xpointer and malformed.
*
* @param rel_document document for relative URIs
* @param uri the URI to watch
*/
/**
* Detaches from the currently attached URI target, if any;
* the current referrent is signaled as NULL.
*/
void detach();
/**
* @brief Returns a pointer to the current referrent of the
* attached URI, or NULL.
*
* @return a pointer to the referenced SPObject or NULL
*/
/**
* @brief Returns a pointer to the URIReference's owner
*
* @return a pointer to the URIReference's owner
*/
/**
* Accessor for the referrent change notification signal;
* this signal is emitted whenever the URIReference's
* referrent changes.
*
* Signal handlers take two parameters: the old and new
* referrents.
*
* @returns a signal
*/
return _changed_signal;
}
/**
* Returns a pointer to a URI containing the currently attached
* URI, or NULL if no URI is currently attached.
*
* @returns the currently attached URI, or NULL
*/
return _uri;
}
/**
* Returns true if there is currently an attached URI
*
* @returns true if there is an attached URI
*/
bool isAttached() const {
return (bool)_uri;
}
/* Private and definition-less to prevent accidental use. */
};
}
/**
* Resolves an item referenced by a URI in CSS form contained in "url(...)"
*/
#endif // SEEN_SP_URI_REFERENCES_H
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8 :